 |
|
|
|
 |
Leon
88mph

Registered: Nov 2004
Location: Nov 2004
|
|
|
Feb-04-2005 01:55
|
|
|
 |
 |
Leon
88mph

Registered: Nov 2004
Location: Nov 2004
|
|
|
Feb-04-2005 01:58
|
|
|
 |
 |
tribu
Guest
Registered: Not Yet
Location:
|
|
|
Ive got what you need. Give me a second and ill post a global pause function in actionscript, and also a timer. Youll need to use a movie clip and the
onClipEvent(EnterFrame){} command to check every frame for the 10 minute mark.
I recommend running at at least 15 FPS
|
|
Feb-04-2005 02:01
|
|
|
 |
 |
tribu
Guest
Registered: Not Yet
Location:
|
|
|
GLOBAL PAUSE FUNCTION
_global.gPause = function (sec:Number){
var target:Number;
var time:Number;
time = getTimer();
target = time + (sec * 1000);
do {
time = getTimer();
}while(time < target)
}
[I]You can call this anywhere onbce its been declared with : gPause(10);
ON 10 MINUTES END
onClipEvent (load){
_gloabl.now = getTimer();
_global.target = now + 600000;
}
onClipEvent (EnterFrame){
_global.now=getTimer();
if (now < target){
}
else if (now >= target){
this.gotoAndPlay(LAST.FRAME.NUMBER(OR LABEL).GOES.HERE);
}
}
This one declares global variables when the movie clip is loads on the screen. It then checks to make sure the current time (in milliseconds) is less than the target (startup + 10 minutes) end time. Once the target time is reached or exceeded, The movie clip goes to the last frame, which should have the command:
stop();
This will end the movie.
One thing to note is that if this clip is loaded multiple times, the script will not work. Make sure this movie is only loaded once, and that it is done first.
I blame any errors in my script to extreme exhaustion.
The keyboard thing is a bit harder. Im working with it now.
|
|
Feb-04-2005 02:10
|
|
|
 |
 |
tribu
Guest
Registered: Not Yet
Location:
|
|
|
ok, this should provide a nice scripting base for your Space Bar requirement:
//this will go in your globals layer,
//or in your first loaded movie clip. Either way, make sure it is only executed once!!
_global.StartTime = getTimer();
//this will go in the main stage's movie clip
on (keyPress "{Space}!!These curly brackets are really Greater than/less than signs that dont show up on these forums!!"){
var CurrentTime:Number = getTimer();
if (CurrentTime < (StartTime + VARIABLE)){
//Variable here refers to
//either 3 mintues or 15 second. Remember, getTimer is based on
//milliseconds, and must be expresssed that way!
}
else{
_root.PICTUREOBJECT._visible = true;
//its past the time limit, it shows the picture thing.
//Probably also helpful here would be a
//this.gotoAndPlay(# or label) which would run through
//a predefined period of time before hiding the picture
}
If you need help further implementing it, telling you wtf i mean, or helping in general, pm me.
Last edited by on Feb-04-2005 at 02:43
|
|
Feb-04-2005 02:20
|
|
|
 |
 |
tribu
Guest
Registered: Not Yet
Location:
|
|
|
I just made a few error corrections. Like I said, code may not be fool proof, but should be at least 85% accurate. If you need help with the actual design/implementation, and I have some free time, I will donate to your project in exchange for your help beta testing a flash game i am making this quarter.
|
|
Feb-04-2005 02:45
|
|
|
 |
All times are GMT. The time now is 23:44.
Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
|
HTML code is ON
vB code is ON
[IMG] code is ON
|
|
|
|
|
|
Contact Us - return to tranceaddict
Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
|