Skip to main content
Known Participant
October 28, 2022
Question

Trouble with publishing to sprites

  • October 28, 2022
  • 2 replies
  • 319 views

Dear All thank you for your time.

I have a animation that when I publish to normal images it works fine, but when I publish using sprite sheets 

wierd things happen.

Some animations are slow to start(click on movie clip takes a second or so to start.)

other take a few times to make them work

somtimes animations flash on and off.

I am using the latest creative cloud animate that is uptodate.

When I republish as per normal images all work as planned.

Is this normal and sprites do not realy work in animate?

Best Regards

Peter

 

 

    This topic has been closed for replies.

    2 replies

    Known Participant
    October 31, 2022

    Thank you very much for reply

    Sorry have covid so have been laid up a few days.

    Hard to put as a prototype, I did some work with the images in the files and replaced some with tweens to reduce the size 

    got the animation down to about 7 meg now from 20+ it seems to work.I just thought it was something to do with using sprites.I have a suplemental question regarding javascript if I may ask it concerns joining the && || operators in a if statements.

     

    This code works

    if ( this.swpanel_main.bat_mc.currentFrame == (5)&& this.inst2_mc.currentFrame==(0)||
    				this.main_mc.busb_mc.currentFrame==(0)){
    			//this.swpanel_main.bat_mc.gotoAndStop(5)
    			//this.bat_sw2.gotoAndStop(5)
    			this.main_mc.batrelay_mc.gotoAndStop(3)
    			this.bata_mc.gotoAndPlay(1)	
    			this.bata_mc.visible = true
    			this.main_mc.batp_mc.gotoAndStop(4)
    			setTimeout(control.bind(this),100);		
    					
    		}

     and I am using HTML 5 Canvas

    This will not work 

    if ( this.swpanel_main.bat_mc.currentFrame == (5)&& this.inst2_mc.currentFrame==(0)||
    				this.main_mc.busb_mc.currentFrame==(0)){
    			//this.swpanel_main.bat_mc.gotoAndStop(5)
    			//this.bat_sw2.gotoAndStop(5)
    			this.main_mc.batrelay_mc.gotoAndStop(3)
    			this.bata_mc.gotoAndPlay(1)	
    			this.bata_mc.visible = true
    			this.main_mc.batp_mc.gotoAndStop(4)
    			setTimeout(control.bind(this),100);	}
    
    I want the inst2 and busb to ored against main bat even putting	like this will not work
    else if ( this.swpanel_main.bat_mc.currentFrame == (0)&& (this.inst2_mc.currentFrame==(0)||this.main_mc.busb_mc.currentFrame==(0))). I have searched internet but cant seem to find away to do it, all they have is non complex operations not this type.
    				

    Thanks for your help apreciate it, I live in Brunei only here I can get help.

    Best Regards

    Peter

    kglad
    Community Expert
    Community Expert
    October 31, 2022

    this works:

     

    if ( this.swpanel_main.bat_mc.currentFrame == (5)&& this.inst2_mc.currentFrame==(0)||
    				this.main_mc.busb_mc.currentFrame==(0)){
    			//this.swpanel_main.bat_mc.gotoAndStop(5)
    			//this.bat_sw2.gotoAndStop(5)
    			this.main_mc.batrelay_mc.gotoAndStop(3)
    			this.bata_mc.gotoAndPlay(1)	
    			this.bata_mc.visible = true
    			this.main_mc.batp_mc.gotoAndStop(4)
    			setTimeout(control.bind(this),100);		
    					
    		}

     

    and this does not:

     

    if ( this.swpanel_main.bat_mc.currentFrame == (5)&& this.inst2_mc.currentFrame==(0)||
    				this.main_mc.busb_mc.currentFrame==(0)){
    			//this.swpanel_main.bat_mc.gotoAndStop(5)
    			//this.bat_sw2.gotoAndStop(5)
    			this.main_mc.batrelay_mc.gotoAndStop(3)
    			this.bata_mc.gotoAndPlay(1)	
    			this.bata_mc.visible = true
    			this.main_mc.batp_mc.gotoAndStop(4)
    			setTimeout(control.bind(this),100);	}

     

    i don't see any difference except ,after the above, you write something that's poorly presented and with, at least, one coding error:

    I want the inst2 and busb to ored against main bat even putting	like this will not work
    else if ( this.swpanel_main.bat_mc.currentFrame == (0)&& (this.inst2_mc.currentFrame==(0)||this.main_mc.busb_mc.currentFrame==(0))). I have searched internet but cant seem to find away to do it, all they have is non complex operations not this type.

     

    do you mean this fails to do what you want:

     

    if ( this.swpanel_main.bat_mc.currentFrame == (5)&& this.inst2_mc.currentFrame==(0)||
    this.main_mc.busb_mc.currentFrame==(0)){
    //this.swpanel_main.bat_mc.gotoAndStop(5)
    //this.bat_sw2.gotoAndStop(5)
    this.main_mc.batrelay_mc.gotoAndStop(3)
    this.bata_mc.gotoAndPlay(1)
    this.bata_mc.visible = true
    this.main_mc.batp_mc.gotoAndStop(4)
    setTimeout(control.bind(this),100);

    } else if ( this.swpanel_main.bat_mc.currentFrame == (0)&& (this.inst2_mc.currentFrame==(0)||this.main_mc.busb_mc.currentFrame==(0)){

    // something?

    }

    Known Participant
    October 31, 2022

    Thanks for your reply

    Yes will not overide the function when inst is activated or the busb activated

    I am struggling with some things, I came back after a break to work with AS3 found now its JS, no courses here to learn and I found most animate courses are only still interested in as3 with sprinklings of JS, can you recomend a good Animate JS course that is a little more advanced with how to create classes imbed text and other advnced functions. I had a great book telling how to make awtch with objects and classes for action script but not much published on Create JS for Animate only banner adds ect which do not have the functionallity to develop a aircraft training simulator. .

    Best Regards

    Peter

    JoãoCésar17023019
    Community Expert
    Community Expert
    October 28, 2022

    Hi.

     

    Are you using the HTML5 Canvas document? If so, can you give as an example?

     

    Regards,

    JC