简体   繁体   中英

Adobe animate CC Javascript gotoandplay delay

recently i have changed from AS3 to HTML5/javascript and i really; want to know how to make javascript;to put a delay when i click a button to gotoandplay a certain frame after 2 seconds in my timeline.In AS3 was that:

function seatbelt_clicked(e:MouseEvent):void{
    setTimeout(gotoAndPlay, 2100, 2);
}

seatbelt.addEventListener(MouseEvent.CLICK,seatbelt_clicked);

I'm not sure if I completely understand your English, but just to be clear...Y-you don't have frames in javascript or html5. You have...divs I guess. The delay function in java-script can be found here . It's the same as the one you're using from flash.utils

However, if you have arguments in your javascript callback function reference this how-to .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM