Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
|
|
Delay in actionscript |
Page: 1 | Reply |
Sep 7th 2003 | #120901 Report |
Member since: Dec 24th 2001 Posts: 222 |
is there a command in actionscript to create a delay such as: delay(integer); and if so what is it? if there isn't then could someone suggest an alternative that doesn't involve using more then one frame? |
Reply with Quote Reply |
Sep 8th 2003 | #120987 Report |
Member since: Apr 25th 2003 Posts: 1977 |
pauseDuration = 2*1000; framesInLoop = 1; if (startTime == null) { startTime = getTimer(); gotoAndPlay (_currentframe-framesInLoop); } else { lapsedTime = getTimer()-startTime; if (lapsedTime < pauseDuration) { gotoAndPlay (_currentframe-framesInLoop); } else { startTime = null; } } pause duration - set the "2" to how ever long you want (this is in seconds) frames in loop - how many frames u want the pause to run over. U need atleast 2 frames. One frame with this script..one empty one before it. |
Reply with Quote Reply |
Sep 10th 2003 | #121413 Report |
Member since: Dec 24th 2001 Posts: 222 |
well being im not a big programmer i really dont understand that and also like i said i can only use one frame. I thought about it and came up with this: function timer() { dateObj = new Date(); _root.entirebar.count = dateObj.getSeconds(); do { upToCount = dateObj.getSeconds(); } while ((upToCount - count) <= 1); } and remember i only need a one second delay in a different loop of mine so i figured if i just made flash execute a loop that does nothing until a second had passed by then it would give me a second delay but for some reason this seems to be a never ending loop can you see why? and it may not be a never ending loop, im not sure, but its one that causes the program to not execute because its going through that loop....any help will be appreciated. |
Reply with Quote Reply |
Page: 1 | Back to top |
Please login or register above to post in this forum |
© Web Media Network Limited. All rights reserved. No part of this website may be reproduced without written permission. Photoshop is a registered trademark of Adobe Inc.. TeamPhotoshop.com is not associated in any way with Adobe, nor is an offical Photoshop website. |