Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-28-2012, 10:14 AM   #11
hahaitwork
Registered User
 
Join Date: Feb 2012
Posts: 13
Default

Ehm, just woundering.. Dont know how the language for "air" is, but would that AS u wrote for the flash work for Air? or is it only As2 ? and AS3 (?)
hahaitwork is offline   Reply With Quote
Old 02-28-2012, 06:13 PM   #12
neilmmm
Senior Member
 
neilmmm's Avatar
 
Join Date: Oct 2005
Location: dorset
Posts: 1,637
Default

The code I wrote is as2 and would need to be changed for as3

I have no experience with air I suggest you start a new thread for that question

If you do not understand any of the code ask. It is an excellent learning project. A nice one to add sound to for instance. You need to work out how to stop and reset perhaps have a timer going.
neilmmm is offline   Reply With Quote
Old 03-01-2012, 06:08 AM   #13
hahaitwork
Registered User
 
Join Date: Feb 2012
Posts: 13
Default

Quote:
Originally Posted by neilmmm View Post
The code I wrote is as2 and would need to be changed for as3

I have no experience with air I suggest you start a new thread for that question

If you do not understand any of the code ask. It is an excellent learning project. A nice one to add sound to for instance. You need to work out how to stop and reset perhaps have a timer going.
Yeah I agree with you You have indeed helped me enough and I will learn it when I got time to sit down with it, atm I have too much work to do
Thx again!
hahaitwork is offline   Reply With Quote
Old 03-03-2012, 04:42 PM   #14
hahaitwork
Registered User
 
Join Date: Feb 2012
Posts: 13
Default

Quote:
Originally Posted by neilmmm View Post
The code I wrote is as2 and would need to be changed for as3

I have no experience with air I suggest you start a new thread for that question

If you do not understand any of the code ask. It is an excellent learning project. A nice one to add sound to for instance. You need to work out how to stop and reset perhaps have a timer going.
Okey I have understood almost everything in the code and it worked prefectly.
I got one question thought:
function mover() {
ran = Math.floor(Math.random()*5);
mc_array[ran].play();
setTimeout(mover, 1000);

}
counter.text = counter;
setTimeout(mover, 500);

I see the "setTimeout(mover, 1000);" speeds up how fast they pop up etc, BUT what is "setTimeout(mover, 500);" doing?
hahaitwork is offline   Reply With Quote
Old 03-03-2012, 08:45 PM   #15
neilmmm
Senior Member
 
neilmmm's Avatar
 
Join Date: Oct 2005
Location: dorset
Posts: 1,637
Default

setTimeout(mover, 500);

setTimeout is like setInteval but is called only once

so setTimeout calls the function mover in 500/1000 sec (ie 1/2 a sec) later. it is a short delay before the first one pops up. afeter that i call it every 1000/1000 sec (ie a second later) to get the next one up.
neilmmm is offline   Reply With Quote
Old 03-04-2012, 12:28 AM   #16
hahaitwork
Registered User
 
Join Date: Feb 2012
Posts: 13
Default

Quote:
Originally Posted by neilmmm View Post
setTimeout(mover, 500);

setTimeout is like setInteval but is called only once

so setTimeout calls the function mover in 500/1000 sec (ie 1/2 a sec) later. it is a short delay before the first one pops up. afeter that i call it every 1000/1000 sec (ie a second later) to get the next one up.
Ahha.. I see

Runned into another "problem" now, sorry about all this but I like to use the people that can help me when I got the chance!

Im using this code:
timer = 30
fcountdown = function () {
timer -= 1
if (timer<=0)
gotoAndStop(3);

}
myInterval = setInterval(fcountdown, 1000)

And it works perfectly because when it hits 0 it go to frame 3 as I want, BUT
when i press the button to restart the game, it go down -2 at a time, like I have started it twice.. and if I dont change frame it will keep going to -1, -2, -3 etc.
So I need this to stop at 0 and then restart when it come to frame 2 in the game.

Sorry for bad explain, its really late and I just wanted to post it before I went to bed.
Good night, and thanks!
hahaitwork is offline   Reply With Quote
Old 03-12-2012, 07:52 AM   #17
hahaitwork
Registered User
 
Join Date: Feb 2012
Posts: 13
Default

Quote:
Originally Posted by hahaitwork View Post
Ahha.. I see

Runned into another "problem" now, sorry about all this but I like to use the people that can help me when I got the chance!

Im using this code:
timer = 30
fcountdown = function () {
timer -= 1
if (timer<=0)
gotoAndStop(3);

}
myInterval = setInterval(fcountdown, 1000)

And it works perfectly because when it hits 0 it go to frame 3 as I want, BUT
when i press the button to restart the game, it go down -2 at a time, like I have started it twice.. and if I dont change frame it will keep going to -1, -2, -3 etc.
So I need this to stop at 0 and then restart when it come to frame 2 in the game.

Sorry for bad explain, its really late and I just wanted to post it before I went to bed.
Good night, and thanks!
I have solved the problem
hahaitwork is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:45 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.