Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




A Delay In For - In Loop



Hi,

Can anyone help me to have a delay in a for-in loop (i.e) I am changing the instance name of a dynamic text dynamically using a for - in loop. I need this to happen after 1000 milliseconds (i.e) after 1 sec the instance name will change and a different text will be loaded inside the textbox.

Thanks in advance



Ultrashock Forums > Flash > ActionScript
Posted on: 2004-09-06


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

For Loop And Delay In It
Here is my code

for (i=0;i<=l;i++){
duplicateMovieClip("naslov","naslov"+i,i);
naslov0._x=naslov._x;
["naslov"+i]._visible=true;
this["naslov"+i].slova.slova1=ime.substr(i,1);
this["naslov"+i]._x=this["naslov"+[i-1]]._x+10;
this["naslov"+i].gotoAndPlay("idemo");
vrijeme=getTimer();
t=vrijeme;
while (t+2000>vrijeme) {vrijeme=getTimer();}}

well part of my code, it is a part of a function, so what i want to do is that in for loop there is some kind of a delay so that this duplicate movie clip wouldnt go all at teh same time, i would rather want it to go one after the other, so my question is what is wrong ( it is not the syntax something else is, how should i resolve this??
please help

Delay In For Loop
Delay in for loop

i m duplicating one MC using for loop, now i want some delay between duplication, so it appear one MC after one. in F5.
[Edited by laxmi19885 on 09-27-2002 at 05:22 AM]

Delay Within For Loop
Now, before I get slated for asking this question, I have searched for the answer in this & other forums, but I still can't get my head around this.

I need to have a delay built in within a "for" loop, so that it works something like this:

for(x=0;x<10;x++)
{
// code that generates button - I have this working

// delay of 75 miliseconds before continuing the loop - can't get this to work!!

}

A Delay In A For Loop....
I am pretty sure that this is not possible in the for lopp...but...here's what I am trying to do and am drawing a blank.

Currently, I am using a for loop to dynamically create some buttons using the attachMovie action, like this:

code:
for (k = 0; k < totalbuttons; k ++) {
item = attachMovie("smallBtn", "smallBtn"+k, k);
item._x = 0;
item._y = 40 + (k * 18);
}


Where k increases to the total amount of buttons needed each time. You get the idea....

Here's the thing...I've created a really nice AE-style button fade in, but they all seem to come in at once and the effect loses it's "charm." I'd like these buttons to come in one at a time (not necessarily after the effect on the button before it is done) so that there is somewhat of a time lag in between each btn being created. With the for loop, they all come in instantaneously and, of course, all have the effect transition at the same time.

Is there a different structure I should use in the function instead of a for loop? (this for loop is inside of a much larger function which I did not post, thinking it wasn't necessary.)

Anyway, I think I've written enough for someone to get the gist of my questions...

Thanks in advance all!

RH

Delay For MC Loop Help
I'm a, somewhat, beginner actionscripter and I've created a movieclip with a loop delay of 10000 (10 sec). I was wondering how could I render the mc's looping at random delay intervals.

This is what I have on my movieclip now;


Code:
onClipEvent(load) {
delay = 10000; // 5000 milliseconds == 5 seconds
startTime = getTimer() + delay;
}
onClipEvent(enterFrame) {
if (getTimer() > startTime) {
startTime = getTimer() + delay;
this.gotoAndPlay(2);
}
}

Delay Loop
Hi

Since my earlier post might not have been clear I have made some changes to the uploaded example Fla.
I am struggling with the delay from the xml slideshow in this tut:

LINK

Everything works fine when publishing the swf from the slideshow fla´s.
The problem happens when loading these swf´s into an mc of another fla (the "mockup fla" in my example)

The example mockup swf loads 2 slideshow swf´s . Swf 1 contains 3 jps and swf 2 contains 1 jpg. When loading swf 1 first, the only jpg for that slideshow is loaded (yes, only loading one pic for a slideshow seems strange but this is just to clarify the issue). Everything works fine so far.
Now I load the the first slideshow swf with the corresponding button. The 3 jpg´s load and loop with a delay like planned. All good.
Now load the 2n´d swf again....... now the single jpg always loop reloads.
Why is this happening?

I´m not sure if this is entirely an AS issue.

Am I making any sense

desperately need some feedback

[F8] Delay Loop?
Hey guys,

I was just wondering the simplest way to add a delay into a function. I have a fadeout function and I just want it to wait 3 seconds before fadeing out. Is it best to use setinterval or can I use a for loop?


function fadeoutwait() {
this.onEnterFrame = function(){


if(this._alpha > 0){
this._alpha -= 10
}
if(this._alpha<=0){
this._visible = false;
delete this.onEnterFrame;
}}}

Thanks in advance

Delay A Loop?
I have a loop that creates MCs on the stage in a grid, my problem is it loops through instantly, is there anyway to put a pause in so that each movie clip is added to the stage say every second?

Thanks

Delay In For Loop
Hey guys, I've done the search but still can't manage to get it working properly. I got help on this board with a cool stage building effect however it all happens at once. (Each square goes into position at the same time). I wanted to add a small delay just to enhance the effect and tried with setInterval but I've had no luck.


Code:
//set the number of blocks width and height:
rectangleWidth = 30;
rectangleHeight = 12;
//squareSize is the width/height of the building blocks
squareSize = 15;
// Starting point of animation
//create a grid of rectangles using an embedded loop:
for (var i = 0; i<rectangleHeight; i++) {
for (var j = 0; j<rectangleWidth; j++) {
this.attachMovie("square","square"+i+"_"+j,this.getNextHighestDepth());
curSquare = this["square"+i+"_"+j];
//set the final position of each sqaure in the rectangle:
curSquare.xPos = j*squareSize;
curSquare.yPos = i*squareSize;
//position each sqaure randomly on the stage:
curSquare._x = Math.round(Math.random()*Stage.width);
curSquare._y = Math.round(Math.random()*Stage.height);
}
}
//sets the build animation running using an enterframe script for
//every square in the rectangle:
function buildRectangle():Void {
for (var i = 0; i<rectangleHeight; i++) {
for (var j = 0; j<rectangleWidth; j++) {
curSquare = this["square"+i+"_"+j];
curSquare.onEnterFrame = function() {
//the difference between my final pos and my current pos:
this.xDif = this._x-this.xPos;
this.yDif = this._y-this.yPos;
//move the sqaure a certain amount depending on how
//far I am away from my final destination.
//if I am very close, snap me into my final position.
if (this.xDif>1 || this.xDif<-1) {
this._x -= this.xDif/10;
} else {
this._x = this.xPos;
}
if (this.yDif>1 || this.yDif<-1) {
this._y -= this.yDif/10;
} else {
this._y = this.yPos;
}
//if I am in my final position delete my enterframe:
if (this._x == this.xPos && this._y == this.yPos) {
delete this.onEnterFrame;
}
};
}
}
}
buildRectangle();

For Loop Delay?
Okay so this is what I want to do.. I have 13 buttons, I want each one to fade in using actionscript, my fade function works... now I'm calling it withing this for loop.

for (i = 1; i < 13; i++)
{
fade(menu_mc.model_mc['btn'+i], 'in', 0, 100, speed4);
}

That will make each button 1-12 fade in at the same time, is there a way where I can have it fade one, than another, than another until it hits 12?

How To Add A Delay To A Loop?
I want to repeatedly add a movie to the stage using add child so have created a loop to add it 30 times. How can I make it so they aren't all added at the same time. I'd like to be able to set an interval of time between them being added.

Thanks.

For Loop With Delay
I have been looking through this forum as well as all others I know of and cannot find a simple example to help me get through this. Everything I find is more complicated than what I need and since I don't know many of the basics of AS I have trouble breaking it down to what I need.

I am trying to use a for loop with maybe a one or two second delay.

The for loop is set up to run the attachMovie command 7 times.


Code:
for (var i = 0; i<8; i++) {
clip= _root.attachMovie("square", "square"+i, (1+i));
clip._x = i+100;
clip._y = 50;

Loop With Delay
how can i make a function example() be repeated 5 times with a delay of 3 seconds in between?

regards,
stijn

Delay Loop
Hi

Since my earlier post might not have been clear I have made some changes to the uploaded example Fla.
I am struggling with the delay from the xml slideshow in this tut:

http://www.kirupa.com/developer/mx20..._slideshow.htm

Everything works fine when publishing the swf from the slideshow fla´s.
The problem happens when loading these swf´s into an mc of another fla (the "mockup fla" in my example)

The example mockup swf loads 2 slideshow swf´s . Swf 1 contains 3 jps and swf 2 contains 1 jpg. When loading swf 1 first, the only jpg for that slideshow is loaded (yes, only loading one pic for a slideshow seems strange but this is just to clarify the issue). Everything works fine so far.
Now I load the the first slideshow swf with the corresponding button. The 3 jpg´s load and loop with a delay like planned. All good.
Now load the 2n´d swf again....... now the single jpg always loop reloads.
Why is this happening?

I´m not sure if this is entirely an AS issue.

Am I making any sense

desperately need some feedback

Delay In A For Loop
The titles a bit vague, but it's the best way I could have put it.


Code:

for (var i = _currentframe; i>0; i--) {
trace(i);
prevFrame();

}
I have the above code, which should go reverse through my timeline and I believe it does so. But at the moment it skips right back to frame 1, how do I get a delay so that it goes from frame to frame gradually.

I've been using flash since November, so it's mostly new to me and this is a great site.

Thanks

Delay For Loop
Hello,
after looking all over google, and many other sites
and decompiling flash... looking at useless examples,
I've broken down and need some help with this simple function.

My problem is that I have 6 pictures, I need to automatically
cycle through this list of pictures after about 15 seconds.

After 4 hours, the best idea i have is to use a for loop
and then try to somehow delay the loop. Which has been
a great unsuccess... I have tried if, if else, if elseif else, and
nearly every other kind of loop or statement that I could think of
and here is my code right now...

btn(1-6) refers to a button
pics is the instance name of the movie clip that all the pictures are stored in


Code:
chngPic = setInterval(changePic,1500);
myDelay = setInterval(delay,2000);

function delay() {
trace("im just sitting here");
}


function changePic() {
var i = 1;
for(i=1;i<7;i++){
stkDown("btn"+i);
pics.gotoAndPlay("pic"+(i ));
delay;
}
}
I'm not really an ActionScript guru, and really need some help on this.
If you have any concepts for me to try, or a code, anything, please
let me know what you have for me.

For Loop With Delay
I have been looking through this forum as well as all others I know of and cannot find a simple example to help me get through this. Everything I find is more complicated than what I need and since I don't know many of the basics of AS I have trouble breaking it down to what I need.

I am trying to use a for loop with maybe a one or two second delay.

The for loop is set up to run the attachMovie command 7 times.


Code:
for (var i = 0; i<8; i++) {
clip= _root.attachMovie("square", "square"+i, (1+i));
clip._x = i+100;
clip._y = 50;

Add Delay To For() Loop?
Last edited by Codemonkey : 2007-05-25 at 10:12.
























ok - basically need to create a bunch of mc with dupMc but want there to be a slight pause(.5 sec) between each one. Is this possible? Had no luck with timers etc but mayeb that's the best option? thanks!


ActionScript Code:
var navx:Array = ["start", "BACK 1 WEEK", "CURRENTLY SHOWING", "FORWARD 1 WEEK"];
totbtnb = navx.length;
 
//
for (nv=1; nv<totbtnb; nv++) {
    duplicateMovieClip(nav_month.nava0, "nava"+nv, nv);
    tgt = nav_month["nava"+nv];
    tgt_p = nav_month["nava"+(nv-1)];
    //
    tgt.txtbtn = navx[nv];
    tgt._alpha = 0;
    tgt.customFade(100,8);
    //
    tgt.txtbox.autoSize = "left";
    tgt.rend._x = tgt.txtbox._width+11;
    tgt.mdl._width = tgt.txtbox._width-11;
    //trace(nv+" "+navx[nv]);
    if (nv>1) {
        tgt._x = tgt_p._width+tgt_p._x+10;
    }
    tgt.nava0._visible = 0;
}

Delay In Loop?
how do you put a delay in your loop?

Ex.
for every time it loops, i want it to delay a half a second. so it will draw a line, wait a half of a second, then draw another.

ActionScript Code:
var line
var x1 = 0;
var y1 = 20;
for(line = 50; line <= 400; line += 10){
    x1 = x1 + 10;
    y1 = x1 + 10;
    lineStyle(1, 0x000000, 100);
    moveTo(10, y1);
    lineTo(x1, 400);
    _x = 0;
    _y = 0;
}


then once the loop is done ( line gets to 400) i want to reaverse it (erase a line, then wait a half second) and then i want to loop that.

any help would be great!
austin

For Loop Delay
Looking for a way to pause my for loop at the end of each cycle for a specefied amount of time... can it be done... if so is it bad?

How Can I Make A Delay Within A Loop
im facing a problem.. and i hope some1 has faced it but solved it..

what i want to do is :
1- create a box. - thats the easy part!-
2- i want that box to change its alpha from "lets say" from 10 to 50.
but i want to be able to watch the alpha while it is beeing
changed - as in motiontween -.

what i did is that i created the box.. and using a loop that changes "x" which is the alpha degree of the box.. but i only see the final result..
so i thought i'll make a delayer that takes 1 sec. every time it executes the loop.. but the player halts till that time is over.. and i see the final result again..

CAN ANY! HELP ME...........PLEASE

Time Delay Loop
hi,

i have captured my desktop throgh Lotus screencam. that is full lenth avi file (30min) now i want to pause the avi file for baloon text and after 5min or 7min it should play automatically. i will put 8 to 10 pauses

this is tutorial project

very very urgent
please help

Audio Loop Delay
I have a problem with 3-4 delay between loops of my flash interface. I have music so it kinda kills the effect. I had the music as a wav fie and now its an mp3. The mp3 has reduced the file size but the delay is still there. Should I use actionscript 2 to try and get around this? The music is only about 15 secs long....

Interval Delay In A For Loop
Hi i was wondering if anyone could help me out a little, im very stuck.

I have searched various sections of the form for a solution for this but i cant seem to find the correct answer, or one that i think i can impliment.

At the moment i have a function that is called which has a for loop inside

Imagine that you pass createPlayers(200);


Code:
var playersArray= new Array();/// new array to hold the new objects

function createPlayers(numberofplayers) {
for (i=0; i<numberofplayers; i++) {
targetCount++;// counts howmany players have been added
newXpos= random(500);
newYpos= random(400);
var newplayer= new Player(newXpos, newYpos, i);// new object from an actionscript file
playersArray[i] = newplayer;

}
}

I want to run this for loop to create the 200 instances every 0.5 seconds or so. Is there a simple way to do this with the code above?

any help is much appreciated.

regards

alan

Delay In Each Cycle Of For Loop?
Hola my friends...

Is there an easy way to delay a for loop so that there is, let's say 2 seconds between each "loop"?

Samantha G.

Adding A Loop Delay
Code:
function buttonsUp(items, topic, xvalue) {
numMenuItems = items;
for (i=0; i<numMenuItems; i++) {
duplicateMovieClip("_root.blob", "blob"+i, i);
_root["blob"+i]._y = (460)-(i*_root.blob._height);
_root["blob"+i]._x = xvalue;
_root["blob"+i].text = _root[topic+(i)];
_root["blob"+i].onPress = function() {
trace(topic+this.text);
_root.away();
loadMovieNum("caseStudies.swf", 5);
};
}
}
Is there any way for me to add a delay between each increment in the loop, ie so that the next movie would duplicate a split second later than teh one before for example.

For Loop + Duplicate + Delay?
I have a "duplicate" syntax inside a "for" loop... just wonder if I could delay each newly duplicated instrance which appears on the screen?

that is they would appear 1 by 1 (e.g. 1 sec timegap between each one)...
(see attached file, whenever I use for loop... all the action would be run at once...)
*I don't want to use more than 1 frame

thanks.

Placing A Delay In A While Loop
Hi all

I have 100 dynamically generated clips on a stage.

I want to remove the clips one by one over the course of a few seconds.

Can I put a delay into a while loop to make it only loop every 50 ms or so?

Thanks.

Problems With Using A Delay Loop
I'm having big problems with this animation http://www.step-up-to-science.com/so...rrent2.fla.zip. *I've grouped all the main objects that I want to animate into one movie clip 'anim1'. *Each of the objects are spaced one frame apart in 'anim1'. *The first part works OK. *The two planets move together, but when they collide, I've tried to introduce some collision effects spaced apart by using a delay movieclip, which then sends it back to the anim1 timeline. *This doesn't seem to be working as the collision effects all happen at the same time. *I can't understand it, as I've used stop(); at every frame on the 'scripts' layer of the 'anim1' timeline and I can't see how I've addressed the 'delay' movieclip incorrectly.

If someone could help, I'd be very grateful!

Philippa

AS3 - Time Delay, In For Loop
Code:
import caurina.transitions.*;

for (var i = 1; i <= 25; i++) {
var mc = this.flower["a"+i];
Tweener.addTween(mc, {alpha:100, time:3, transition:"EaseInExpo"});
}
HI guys i have the above...what i was wandering was how to each clip to fade in 1 sec after each other??

BIg thx to all who post

Tricky Time Delay In While Loop
hello all!

for me it's a tricky question. here's the code:

scaler=100;
while (scaler>10) {
start = getTimer ();
delay = 0;
while (delay<500) {
time = getTimer ();
delay = time - start;
}
scaler =scaler - 5;
_root.movie._yscale=scaler;
_root.movie._xscale=scaler;
}
stop ();

i've got a movieclip called movie on my main timeline. i want that movie to shrink (scale) to a size of 10 percent of it's original size in steps of 5 percent every 0.5 secs by using this script.
i introduce a scaler which counts down to 10 in 5 percent steps and scales my movie each time it loops. i've got a second loop inside the first one to do the time delay.

what my movie does is to start the calculation and then, after 10 seconds (as a result of the loops) it displays the correct end-result: _root.movie is scaled to 10% of it's original size, but it didn't show the 5 percent steps in between!!!

what can i do to make this work (without using a second frame)???
thanks for any help,
elo.

Function And Loop, Duplicate Delay
I wrote some script to duplicate a movie clip. The script lies in 2 functions on frame(1). The function looper is called on frame(2).

The aim is to duplicate the movie clip 5 times, but to delay for .5 of a second so it has a nice transition. So instead of 5 instant movie clips they are duplicated each time on a delay of half a second.

The problem I have is the delay is happening and then the clips are instantly duplicating with no delay between each one.

Check out the script. Hopefully someone can see the silly mistake i am making.


function spacer(){
trace("help");
pausestart = getTimer();
pausetime = 500;
loopnum = 5;
i = 0;
}

function looper(){
spacer();
while(i<loopnum){
if (i==loopnum) {
trace("ended");
gotoAndStop(3);
} else if(getTimer()>pausestart+pausetime){
duplicateMovieClip("line", "line"+i, i);
//setProperty;("line"+i,_y,(_root.line._y)+14*i);
//setProperty("line" + i,_y, 10*i);
setProperty("line"+i, _y, (line._y)+(17*i))
pausestart = getTimer();
pausetime = 500;
trace("line" + i);
trace(i);
i++;
}
}
trace("me");
}

Cheers

Delay On Rollover When Sound Loop Is Off
hello everyone,

I posted yesterday with a issue i was having with a rollover. Basically what was happening was the animations would freeze for about half a second when ever i rolled over a button. I added a sound loop to the mix and that fixed the problem. ( I have no idea why). Today i added a button that toggles the sound on and off. When the sound is on I have no problems but when the sound is off it get the half second delay (or freezing). Anyone have any ideas of what might be causing this?

Oh and they animations are fine on my old laptop but not my new (and powerful) desktop.

Adding A Time Delay To A For Loop
Could someone help me to put a time delay in the for loop. Here is my code as it is now. i have tried many combinations with setInterval with no luck.

Thanks.

The code:

loadVarsText = new loadVars();
loadVarsText.load("test.txt");

loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
scroller.text ="";
var pieces = this.var1.split("
")
for(var t=0;t<=pieces.length;t++){
setInterval(scroller.text = scroller.text + pieces[t], 10000);
trace(t);
}
} else {
trace("not loaded");
}
};

Delay Function That Doesn't Loop
Hey all,

A couple weeks ago, I was searching for a delay function that I could put on a frame and it would hold at that frame for a given period of time.

I came close to finding it, but what I found used setInterval and I wasn't able to stop it from looping.

Here is something that I am quickly starting to love, it's not mine, but I don't know who's it is, it was on a piece I was working on at work (although this edition of it is partly mine, as I have adapted it to my specific needs).

hope this helps someone!

first frame


ActionScript Code:
//wait function    function wait(a) {        stop();        startTime = getTimer();        this.onEnterFrame = function() {            if (getTimer()-startTime>a) {                delete this.onEnterFrame;                play();            }        };    }        //pause between frames var delay = 2000;


then on the frame you want to pause or delay:


ActionScript Code:
wait(delay);

Adding/Controlling Delay In A Loop
Is there any way to add a delay within a FOR loop such as:


Code:
for (var i:int=0; i < 10; i++) {
var termSprite:MovieClip = new MovieClip;
addChild(termSprite);
}
So that after the addChild statement there is pause added in before continuing on to the next iteration?

For Loop That Loads Ten Images - Delay Entire Loading Movie?
Hey there,

I have a for... each loop in flash that takes image urls, creates loader instances, and loads images, adding them to a small image slideshow. Will having this code delay the whole flash movie from loading while it tries to load each image? I was hoping that if the user is on a slow connection, the rest of the flash movie would load and the images would load in while the user can view the flash file... I read on for loops that they are very processor intensive and all other operations cease while they finish but didnt know if this meant the loop finishing or the code inside of them. thanks!
Code:

   for each (var textE:XML in img_xml) {
      var scrollLoader:Loader = new Loader();
      scrollLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, picScrollCompleteHandler, false, 0, true);
      scrollLoader.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownFunction, false, 0, true);
      scrollLoader.name = i.toString();
      var urlReq:URLRequest = new URLRequest(textE);
      scrollLoader.load(urlReq);
      imageContainer_mc.addChild(scrollLoader);

      scrollLoader.scaleX = .23;
      scrollLoader.scaleY = .23;
      
      scrollLoader.x = scrollX;
      scrollX = scrollX + 37;
      i = i + 1;
    }

Why Can't I Change Movie Position/visibility Before A Delay Loop Inside Function?
Can any expert tell me what the problem is here.

All of this is done wthin a function.
Changes (position, visibility) BEFORE delay loop don't though they work AFTER loop

Thanks.

//initialposition mimovie._x=300
//---------------

// position or vibility
// change(mimovie.visible=false)
// do not work

//the container function is called by clicking
on a button wthin the movie

mimovie._x=500


delay1=0
delay2=gettimer()


//pauses fo 1 second //works
while (delay2<1){
delay2=Math.round((gettimer()-delay2)/1000)
}


//the same changes work INSIDE the function but AFTER the delay loop work
mimovie._x= 600

Pulling Images From Folder/txt File, The Images Loop With Delay?
I would like to have a flash movie where images change from one to the next with maybe a 10second delay, and it will loop over n over.

I want flash to take images from a folder or a .txt file stating where the images are found so adding new photos or removing photos from this looped movie will be a breeze.

Any help would be greatly appreciated, thanks!

Images Pulled From Folder/txt File, Images Loop With Delay?
I would like to have a flash movie where images change from one to the next with maybe a 10second delay, and it will loop over n over.

I want flash to take images from a folder or a .txt file stating where the images are found so adding new photos or removing photos from this looped movie will be a breeze.

Any help would be greatly appreciated, thanks!

Images Pulled From Folder/txt File, Images Loop With Delay?
I would like to have a flash movie where images change from one to the next with maybe a 10second delay, and it will loop over n over.

I want flash to take images from a folder or a .txt file stating where the images are found so adding new photos or removing photos from this looped movie will be a breeze.

Any help would be greatly appreciated, thanks!

Delay: Need Escapable Time Delay Actionscript2.0 Function (Flash8Pro)...
Hi,

I am brand new to Flash® 8 Professional. I have many year experiece as a Visual C++ programmer, but am having some troubles learning to code in Actionscript2.0...

I wish to have an Actionscript2.0 function that does the following:
Delay for x milliseconds, but if user clicks mouse in Flash document then delay is immediately over.

Can someone with experience give me some hints on how to code this in Actionscript2.0? I am using Flash® 8 Professional.

Thanks in advance!

P.S. - Working on a Flash® Tetris® game called "TetriCrisis100%™".


JeZ+Lee
Silent Hero Productions®

Delay And Cancel Delay
Hello,

I'm having some trouble delaying single keyframes keyframe in flash.

I'm making a 5 slide slideshow over 5 frames. Each frame needs to last about 4000ms, although this is flexible.
BUT the 4000ms delay must be able to be reset when a button is pressed.

There are 5 buttons on the slideshow allowing a user to return to a previous slide or skip ahead without having to wait.

However the button when clicked switches frame but does not reset the delay set on the previous keyframe. So the whole slideshow goes out of sync until it just flashs different slides repeatedly. I've tried what I consider to be everything but as I am a novice I could do with the help of a pro.

The other problem I have which goes hand in hand with the one above is that I need the movie to pause and then resume when the mouse rolls over and rolls out from a particular area i.e. a button. But I have tried setting on rollover stop and on rollout play wtc (I know the syntax is wrong but I used the correct in the fla file) needless to say it doesn't work.

I have uploaded the fla file to here in case it helps: http://manage.merrions.com/slideshow.zip

I have attached the function i am using to delay each frame.

Thanks in advance

Chris









Attach Code

function wait() {
stop();
var myInterval = setInterval(
function () {
play();
clearInterval(myInterval);
}
, 6*1000);
}
wait();

Any Way Around The Loop Error (loading 8000 Vars, Flash Thinks Its A Loop.)
I have 8000 vars to load....... all at once, so Flash thinks its in a loop at the 3000 mark and gives an error. Is there any way around this?

How Do I Define The Greatest _x Position Based On A Loop, Assuming I Know The Last Element Of The Loop?
Hello,

This may be complicated,

I've a loop that creates emptyMovieClips
then I use one function to onRollOver _xscale them += 10

Now I want to move another movieClip based on the greatest _x position of my previously _xscaled elements, how do I do that?

example

for (var i = 0; i<my_array.length; i++) {
_root.menu_.createEmptyMovieClip("btn"+i, i+1);
}
//
_root.menu_["btn"+i].onRollOver = function() {
this._xscale += 10;
//
MY_DRAGER._x = HIGHT._x;
}

Can this be done?

Thanks,

I Would Like My Sound Loop To Continously Loop Without Looping Over Itself When I Repeat My Images.
I have a sound loop moving along with my flash images. When the flash images finish and I send it back to frame 1, my sound doubles. How can I play my sound loop once, but allow my images to continously loop.

Is there away to just run one loop of sound, and let the image aspect continue to loop.

I would like my sound loop to continously loop without looping over itself when I repeat my images.

Make One Element Loop Without Making Enitre Movie Loop?
i'm trying to make one element continue looping without making the entire movie loop... here's what i mean..

i have a layer that i've name actions which i've asigned a stop(); to at the end of the animation. but i want the red pulsating dot to continue looping/ animating ... to give you an even better idea, here's the swf file...

http://www.push1.com/roster_art_gal.swf

cheers!

LoadVars In A For Loop Not Executing .load Function Until For Loop Completed?
Ok so I have a simply for loop: ID[i] is a global array



Code:


for (i=0;i<12;i++)
{
var loadInfo:LoadVars = new LoadVars();
loadInfo.onLoad=function(success:Boolean)
{
if (success)
{
trace("whatever:"+loadInfo.myname);
}
else
{
trace("Nope");
}
loadInfo.load(ID[i]+".txt");
}



the problem I'm having is that the function doesn't execute until the for loop completes and then it executes 12 times in a row. Output is 'whatever: undefined' 11 times and then 'whatever: Bobble' (which corresponeds to the last .myname value as it should). Why is this? And how can I fix it? To be continued...

~NH

Loop Inside Loop... Why Doesn't Work Properly?
In order to cause a delay, I have put a loop inside another loop. Here it is:

for (a=1; a<6; a++) {
for (b=1; b<10000; b++) {
}
}

Flash delays to show the page but in the end I just see both variables with the maximun value. The point was to see variable "a" growing with delay. What have I done wrong?

Thank you

Copyright © 2005-08 www.BigResource.com, All rights reserved