HELP How Do I Hold So Many Frames After Animation Then Loop Again (repeat)
HELP! How do I hold so many frames after animation then loop again (repeat)
I want my animation to play......hold for 20 secs or so then repeat. How do I do this in swish?
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-24-2002, 02:23 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Hold Frame (seconds) Then Repeat
hello flashkit!
ive been looking around for a simple script that will hold a frame, count to say
5 seconds then repeat from frame 1, over and over.
Ive searched around and some scripts just arn't working. would someone be able to help?
Im using Flash 8.
Ta,
andyk
How To Repeat A Group Of Frames Without Adding A Million Frames?
Hello,
I have made a small flash intro using Flash MX 2004 Professional. The intro is about 3 seconds long. Here's what I want to do:
I want to add a few frames to the intro where I add things shooting through randomly, and I need these few frames to repeat themselves while keeping the main intro sort of paused in the background... How would I do this? How would I "pause" the background without adding a million frames? And is there some way that I can loop a group of frames? Please respond as "newbish" as possible so I can understand
Thank you!
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.
Repeat Frames
hi all..
how to repeat a set of frames...
but this not depend on other frames.. how it possible....
How To Repeat Button To All Frames
I have one layer with 100 frames, i made another layer and i added invisible button but i cant get to repeat this button to all frames i get only in first and the last keyframe the button is not clicable to another frames.
Random Frames, No Repeat
I have a quiz that starts on frame 5 and ends on frame 14.
I'm trying to get it so when you click the next button it randomly selects a frame between 5 and 14 without repeating. Once the frames have all been done, it goes to frame 15.
I have this code below, but when I click next, the trace currentFrame selects 3 frames at a time. Example: click next button, trace output (5), hit next again,
trace output(5 8 12), hit it again, trace output (5 8 12 14 8 3). So I've only hit the next button 3 times, but it's randomly seleced 6 or more frames.(it changes every time)
Code:
var myarr=[0,1,2,3,4,5,6,7,8,9];
function findNewFrame() {
var num=Math.floor(Math.random()*myarr.length);
gotoAndStop(num+5);
myarr.splice(num,1);
if(num<=1)gotoAndStop(15);
trace(currentFrame);
}
Help anyone?
Thanks
Random Frames With No Repeat
Hey guys!
This time I'm trying to access random frames between 1 and 10. That bit's easy, yay for help files.
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
btn.onPress = function() {
n = randRange(1,10);
gotoAndStop(n);
}
Now the problem is that I want it to visit each frame only once. So, to check this, I've popped a simple Boolean at the top of each frame called f1, f2, etc, but only for frames 1-5 for checking purposes. Whether it's frames 1-5 or 1-10 doesn't really matter at this point.
My problem is that I need to check that n against the number in my f variables. It's easy to make a string, but how do I check that against a boolean?
frameCheck = "f"+n;
trace(frameCheck);
I keep feeling like I've almost got it, and then the whole concept eludes me. My immediate problem is the checking, but if anyone knows a better way to do the checking, I'd be grateful (that's the only reason I popped it up there).
Thanks heaps!
Loop Sound On Press And Hold
this._parent._parent.onRelease = function() {
mySound = new Sound(this);
mySound.attachSound("Click.wav");
mySound.start(0, 1);
play();
};
above is the code I am using, how do I modify it to loop the sound
while mouse is down and stop when mouse is up!
Thanks In advance!
Call A Function To Repeat Over A Few Different Frames
I would like to be able to call a function from a movie clip so that the function repeats itself over a few different frames without having to be called again. I could have the function call itself according to an "if" statement but I believe that the movie will not go the next frame until it finishes all the cycles. So for example: The function makes the movieclip move over a few pixels but I want it to move over a bunch of pixels so as to give the illusion that it is moving slowly, I To do that the function needs to repeat until the movieclip moves the entire distance, but if that happens all within the function, at least as far as I have been able to figure out, the movie clip simply jumps to the last position without the viewer seeing each step of its movement.
Does anyone know how to fix this?
How To Keep Hold On The Target When Loading With Loader Loop
So i have to load 20 images with a loop that goes through a loader function and resize them:
Code:
for(var k:uint=0; k<_albumObjects.length;k++){
imageLoaderFuntion(MEDIA_ROOT+_albumObjects[k].cover, _albumsArray[k]);
}
and the loader function looks like that:
Code:
private function imageLoaderFuntion(url:String, target:MovieClip):void{
if (imageLoader != null)
imageLoader.close()
var imageLoader:Loader = new Loader();
configureListeners(imageLoader.contentLoaderInfo);
var image:URLRequest = new URLRequest(url);
imageLoader.load(image);
target.addChild (imageLoader);
}
private function configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.INIT, function(e:Event):void{
rearrange(); // THE PROBLEM
});
}
Now, the whole problem is that i want to resize/rearrange those pictures and i dont have access to them and i dont have reference to the 'just loaded' picture. So basically i want to be able to resize pic x right after it is loaded. and also i want to do other things when all pictures are loaded. All i have for the moment is this:
Code:
dispatcher.addEventListener(Event.INIT, function(e:Event):void{
rearrange();
});
which is a function that can be executed after something (we don't even know what!) is executed. How do i store variable of the 'target' or ... any smarter way to do it?
i can rephrase if not clear...
How To Repeat A For Loop?
Hey all,
as you can probably tell by my post count, i am new! // lo to all! I have been registered here for while and i always check out what peeps are saying here with little time to post. Loving the tutorials as well... very nice!
However my knowledge of AS is weak, i have kinda started form the back in as well - as i know a few people that code a lot and look at their source - whilst myself i studied music at uni etc...
anyway cutting to the chase, i need some advice and was wondering if someone could spare a mo to briefly explain what i should do here...
Code:
for (i=0; i<7; i++) {
this["bubble"+i]._x = 0;
this["bubble"+i]._y = 0;
this["bubble"+i]._xscale = 0;
this["bubble"+i]._yscale = 0;
this["bubble"+i]._alpha = 100;
this.randomVarX = random(80)+50;
this.randomVarY = random(20)-80;
this["bubble"+i].alphaTo(0, 5, "easeOutQuad", 0);
this["bubble"+i].scaleTo(100, 1, "easeOutQuad", 0);
this["bubble"+i].slideTo(randomVarX, randomVarY, 2, "easeOutQuad", 0);
}
I am using Laco code to move my sweet bubbles around, however after the last one has reached an alpha level of about 10 i would like the loop to repeat the for loop. Basic stuff i am sure? Was considering a callback from the last line of laco, or placing an if statement to call an action.
any help is appreciated!
Løque
How Do I Repeat A Loop For Ever?
I have a loop in a movie file, how can I make it loop forever? I tried to add:
gotoAndPlay(1); on the last frame, it works, but you can hear that it's looping, I mean it stops 1 second then loads the sound. I don't want to set that LOOP thing either, it's annoying. Any other ways, thanks
Repeat Loop
Hi everyone,
I have three movieclips that are images. The size of the flash file is the size of one of the images. The others will slide in and out.
I want to make a continuous loop of these images, playing constantly with a tween.
The only hitch is that I have controls which I have written (code below) that I would need to override the constant repeat loop.
Here's that code:
Code:
stop();
// imports the easing and tween class for use globally
import mx.transitions.easing.*;
import mx.transitions.Tween;
// POF means Point of Focus
// Images are described by number
var roomTween:Tween;
// moves one to the left so that two is the POF
function CaruthLeft(mc:MovieClip, easeType:Function):Void {
var begin:Number = 0;
var end:Number = -544;
var seconds:Number = 1;
var useSeconds:Boolean = true;
roomTween = new Tween(mc, "_x", easeType, begin, end, seconds, useSeconds);
}
// moves 2 to the left so that three is the POF
function HamptonLeft(mc:MovieClip, easeType:Function):Void {
var begin:Number = -544;
var end:Number = -1088;
var seconds:Number = 1;
var useSeconds:Boolean = true;
roomTween = new Tween(mc, "_x", easeType, begin, end, seconds, useSeconds);
}
// moves two to the right so that one is the focus
function HamptonRight(mc:MovieClip, easeType:Function):Void {
var begin:Number = -544;
var end:Number = 0;
var seconds:Number = 1;
var useSeconds:Boolean = true;
roomTween = new Tween(mc, "_x", easeType, begin, end, seconds, useSeconds);
}
// moves 3 to the right so that 2 is the POF
function LaceriseRight(mc:MovieClip, easeType:Function):Void {
var begin:Number = -1088;
var end:Number = -544;
var seconds:Number = 1;
var useSeconds:Boolean = true;
roomTween = new Tween(mc, "_x", easeType, begin, end, seconds, useSeconds);
}
/* -- [ begin button attachments ] -- */
// moves one to the left and two is POF
holder_mc.caruth_mc.caruth_door.caruthArrow1_mc.onRelease = function() {
CaruthLeft(holder_mc, Regular.easeInOut);
};
// moves 2 to the left and 3 is POF
holder_mc.hampton_mc.hampton_door.hamptonArrowR_mc.onRelease = function() {
HamptonLeft(holder_mc, Regular.easeInOut);
}
// moves 2 to the right and 1 is POF
holder_mc.hampton_mc.hampton_door.hamptonArrowL_mc.onRelease = function() {
HamptonRight(holder_mc, Regular.easeInOut);
}
// moves 3 to the right and 2 is POF
holder_mc.lacerise_mc.lacerise_door.laceriseArrowL_mc.onRelease = function() {
LaceriseRight(holder_mc, Regular.easeInOut);
}
I'm just not sure how to write the repeating loop. Everything else is golden.
Does anyone have any suggestions?
Thanks!
-B
How To Repeat (go To Frame ...) Looks Like A Loop..
Hello, i have a question and maybe someone knows this.
In my timeline i have put the command "gotoAndPlay (4);"
If i do this.. the movie wil repeat itself infinity..
But i would like to repeat the gotoandplay commando for like 3 times.
As if you loop the time line for 3 times.
Can anybody help me please?
greetings, Chris.
Repeat/loop The Objects
i have 3 bitmap images each in their own keyframe. placed on the same location(X:Y).
layer 6 is where they are located. i converted the gap between each bitmap image into keyframes, but they had about 10 sec gap between each other.
this is from a flash header that i found and trying to edit. how would i loop the 3 bitmap images to keep going?? when i preview it, it only does it once and very fast too. so can anyone help me loop it forever and slow it down??
better yet.. if anyone is highly skilled in flash, help me edit it with some other requests and ill pay u 5-10$ paypal :O its basically done cuz of the template but i cant get some small things to work the way i want it to. if u can help for free, omg thx
Plz Help Me Loop / Repeat A Streaming Mp3
Hello all,
I'm so exhausted from trying to figure this out on my own. I am wanting to loop an external mp3 file that is streaming in flash file. I added the load streaming properties to a key frame on my timeline using the Windows/Behaviors/Sound/Load streaming mp3 file. The sound loads and plays just fine. However, I'd like to repeat it. Does anyone know what I need to add to the actionscript code in the keyframe in order to make it repeat?
Here's what the code looks like now:
//Load Streaming mp3 behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_myMusic',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.myMusic = new Sound(this._parent.BS_myMusic);
} else {
this.createEmptyMovieClip('_myMusic_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.myMusic = new Sound(this.BS_myMusic);
}
_global.Behaviors.Sound.myMusic.loadSound("<A href="http://www.abrohn.com/bombsquad/images/sample.mp3",true">sample.mp3",true);
Thank you for any and all help I can get.
Repeat Animation
ok i have this input text box, and i need to now an action script that will repeat the animation as much as the number i type in the text box. please help.
Repeat A Movie Clip - Loop
Check this out http://users.rcn.com/rmkerr/test_roll
I'm trying to make this appear as a sort of film roll spinning. I figured I would repeat this animation at a steady interval to create that illusion. Can anyone recommend how I code that? Also, is that the best way to create what I'm going after? Thanks for any input.
How Repeat A Part Of An Animation?
i have an animation which contains 30 frames. it has two layers. the first layer has animation till the last frame but the second layer has animation only till the 3rd frame.. now i want the second layer to repeat itself its animation(3 frames) for 10 times till the movie reaches the end(30th frame).. how to do this? do i need any technique using action script?.. please help out..
[CS3] Making A Rollover Action Repeat/loop.
Having trouble with a scrolling type navigation. I have a button which controls the x value of a MC, it works fine on rollOver, but i want the action to repeat on rollOver until the x value gets to a certain point ie. when the user hovers over the button the mc keeps moving, at the moment it only moves 100 pixels and then stops. If i add in any "while" statements it seems to crash flash.
the code is below.
on (rollOver) {
if (_root.dukesmc._x>=-2600) {
_root.targX -= 100;
}
}
thanks,
Nick.
Button Animation Repeat Problem
hello there
i searched for this as i thought there would be hundreds of threads on this but i couldnt seem to find an answer
i have a movieclip inside a button for my rollover animation.
when you click on the button it plays a sound but it also replays the rollover animation.
how can i set my button up so that it will only play the animation once until the mouse has left rollover area and re-entered it again?
thanks in advance
How To Make Background Animation Repeat?
Please help me with this. Thanks.
I am trying to make the background loop again and again.
e.g. The background text "Happy Happy Happy Happy" will move from left to right again and again endlessly looking slowly and smooth.
I tried doing use tweening but as the frame start from frame 1 again, it will blink then loop again.. this is not smooth.
Is there any coding that anyone can help me with.
Thanks.
How Do I Make A Xml Driven Thumbnail Scroller Repeat(loop)
Hey guys -
Please see the attached files to figure this one out-
I am creating a thumbnail scroller and I have everything set to work. The last final issue I'm having is this:
The scroller displays 25 items.
8 at a time.
When you page left/page right it scrolls to the next(or previous) 8 thumbs in the list.
This is what we want to happen:
Once the final (25th) thumb is reached it starts over on the first thumb again and we are back at 1. So that it becomes an endless loop.
// What I've Tried ///////////////////////////////
I tried duplicateMovieClip() so that I could have a second one at the end and then continue to exchange x values but it won't work because I have MCs that are being attached dynamically
///////////////////////////////////////////
Notes: I have included the xml document as a txt so that I could upload it. please convert back to xml when testing.
Repeat A Function X Times? - Crazy Animation...
Hey Everyone!
I am trying to repeat a function x number of times. How do I go about doing that?
Here is the function:
Code:
function dance(){
var animspeed = .4;
var back = 0;
var delay = (animspeed);
var delay1 = (animspeed*2);
var delay2 = (animspeed*3);
body.slideTo(124,304, animspeed, "easeOutSine");
//lowerbody down
body.lowerbody.rleg.rthigh.rotateTo(-30,animspeed,"easeInOutSine");
body.lowerbody.rleg.rthigh.rfoot.rotateTo(40,animspeed,"easeInOutSine");
body.lowerbody.lleg.lthigh.rotateTo(30,animspeed,"easeInOutSine");
body.lowerbody.lleg.lthigh.lfoot.rotateTo(-40,animspeed,"easeInOutSine");
//upperbody flail
body.upperbody.rarm.rotateTo(-70,animspeed,"easeInOutSine");
body.upperbody.rarm.rhand.rotateTo(-30,animspeed,"easeInOutSine");
body.upperbody.larm.rotateTo(70,animspeed,"easeInOutSine");
body.upperbody.larm.lhand.rotateTo(30,animspeed,"easeInOutSine");
//AND BACK!
body.slideTo(124,300, animspeed, "easeOutSine", delay);
body.lowerbody.rleg.rthigh.rotateTo(back,animspeed,"easeInOutSine", delay);
body.lowerbody.rleg.rthigh.rfoot.rotateTo(back,animspeed,"easeInOutSine", delay);
body.lowerbody.lleg.lthigh.rotateTo(back,animspeed,"easeInOutSine", delay);
body.lowerbody.lleg.lthigh.lfoot.rotateTo(back,animspeed,"easeInOutSine", delay);
body.upperbody.rarm.rotateTo(back,animspeed,"easeInOutSine", delay);
body.upperbody.rarm.rhand.rotateTo(0,animspeed,"easeInOutSine", delay);
body.upperbody.larm.rotateTo(back,animspeed,"easeInOutSine", delay);
body.upperbody.larm.lhand.rotateTo(back,animspeed,"easeInOutSine", delay);
}
How could I repeat that function x number of times if I use an on(mousePress) as my event?
Thanks!
Looping Frames X-y For 'z' Amount Of Times Then Proceeding To Frames After Loop
Hi,
I'm relatively new to Flash and have not done much work with the AS. I was hoping someone here could enlighten me on an area which has been stumping me.
I need to know how to loop (for example) frames 1 to 5, 4 times then continue to frame 6 until the last frame, then go back to frame 1, thus re-entering the loop, etc. I do believe it would involve something like this... but then again I'm a newbie to this so... what do I know (which is why I wanna learn)
Frame 1:
i=0
Frame 5:
i=i+1
if (i>4) {
gotoAndPlay(6);
} else if (i<4) {
gotoAndPlay(1);
}
Thanks so much
Putting A Loop "on Hold" Until User Input?
i have a problem and the solution might be simple so i hope someone can help.
i have a loop that moves a game piece every time a dice is tossed using tweens (i loop the movement the amount that comes out on the dice). it all works fine.
the problem is that when mid movement i need to ask a user a quesition with a popup movie with buttons that would determine the movement - i cant pause the loop.
basically i need to know how to put a loop on hold until further user input
if i have a loop that increments a number by one until it hits a predefined amount- i want to pop up a menu that would ask the user if he wants to continue incrementing the number by 1 or by 2. I still want the loop to run a total set amount of times (lets say 100)
anything would help at this point
thank you
Asp For No Repeat Flash For Repeat Visitors?
Hi,
I have a flash animation that I want to execute in full only for first time visitors. I would like it to jump to the end of the animation for return visitors. I think this is easiest to do with an asp cookie by sending a parameter such as "recent_visit=yes" to the flash tag. However, I have no experience with cookies or vbscript. Any help is much appreciated!
Here's what's in my object tag ...
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
ID=blue_arrow
WIDTH=552
HEIGHT=70>
<PARAM NAME=movie VALUE="blue_arrow.swf?recent_visit=yes">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED
src="blue_arrow.swf?recent_visit=yes"
quality=high
bgcolor=#FFFFFF
WIDTH=552
HEIGHT=70
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED></OBJECT>
Thanks!
Cheers,
Jeff
To Hold Or Not To Hold? - On The Frame That Is
I'm trying to get my movie to pause at a frame for a preset amount of time..
Here is the ActionScript i am using
-----------------------
stop 0;
do {
// hold at this frame for preset time, in milliseconds;
} while (getTimer() < 5000);
play 0;
-----------------------
i believe that it doesn't work at the moment because the getTimer function counts milliseconds from the START of the movie and not from when the funtion is executed from the code.
Does anyone know of a funtion to use to correct this?
Thanks in Advance
[Edited by thebogan on 01-16-2002 at 01:39 AM]
Loop Last Frames
probably a stupid question but how do u loop the last frames without looping the whole thing? (ive only used flash for 2 days now). heres a quick somethin i came up with:
http://www.sphosting.com/mg315/intro/intro.html
but instead of having it all restart i just want it to loop the microtext. oh and i know the gfx sux but this was just practice. i was tryin to learn my way around flash before i try anything good.
For Loop For Frames?
ActionScripters,
I am trying to build a black jack game and I have 52 frames. each frame holds a unique value.
for example, this is on frame 1. The point is, I rather NOT write this script and copy/paste of every frame. Can I write loop in this case? for each frame number, increment by 1 for the cardvalue? the syntax i am not sure as i have never wrote a loop for frames. Any help will be appreciated.
if(_root.deal1){
_root.cardvalue1=1;
}
if(_root.deal2){
_root.cardvalue2=1;
_root.totalvalue = _root.cardvalue1 + _root.cardvalue2;
}
if(_root.deal3){
_root.cardvalue3=1;
_root.totalvalue = _root.cardvalue1 + _root.cardvalue2 + _root.cardvalue3;
}
raskolnikov
How Do I Make Frames 11-x Loop?
ok at the end of my movie i want it to keep on blinking my name not starting all over. How do i do that? its on frames 11- something(x)
Looping Between 2 Frames? Can Loop Just 1?
gotoAndPlay("check");
if (_root.doc==8) {
gotoAndPlay("go");
}
so right now i have this in my timeline. it is a 2 frame loop that checks to see if "doc" = 8. if it does, some cool stuff happens.
what i need to know is how can i do that on one frame?
simpler???= right now my movie loops between two frames. the only reason it loops between two frames is to check the value of my var. if the value changes the movie goes to a different part of the time line. how can i check that var with out looping between 2 frames?
[F8] How To... PrevFrame () Loop Of Frames
I am working on building a simple template (Flash 8) that contains a forward and back buttons that will rotate a series of rendered images continuously until the button is released. It’s very similar to what you might find on an automotive web site, displaying a car 360 degrees.
My forward button works great and will continuously loop until the button is released. Here is my code for the forward button:
stop ();
forward_up_btn.onPress = function() {
onEnterFrame = function() {
play();
}
}
forward_up_btn.onRelease = function () {
onEnterFrame = function () {
_root.gotoAndStop(_root._currentframe++);
delete onEnterFrame;
}
}
The problem is my back button. It always stops on the first frame. Note this is not a movie clip. I just can’t seem to get it to continue (i.e. looping until released). Here is my problem code:
back_down_btn.onPress = function() {
onEnterFrame = function () {
if ((_root._currentframe>=2) and (_root._currentframe<=_totalframes)) {
prevFrame();
} else {
onEnterFrame = function () {
_root.gotoAndStop(_root._totalframes);
prevFrame();
}
}
}
back_down_btn.onRelease = function() {
onEnterFrame = function () {
_root.gotoAndStop(_root._currentframe++);
delete onEnterFrame;
}
}
}
Any suggestions/code to make this work would be appreciated.
Thank you (Flash 8)
Help With For Loop For Prev And Next Frames
I'm trying to animate a fader along a motion path (each frame has a stop in the actions layer and there are 30 frames total). I want to be able to find what the currentFrame is and pass a targetFrame ... then have a for loop move to the prevFrame/nextFrame arcordingly. I think I'm just getting turned around in the for loop right now. Been a long time since I've written one. I could be going about this all wrong but the jist is that I have a mixing console and I've got some faders (movieclips) on it and they are all on motion guides (so they stay where they are supposed too). I want to be able to make each one move to a certain place when a button is clicked (so I was thinking of making the above into a class)
Well I did some fiddling around and here's what I have thus far:
Code:
var currentFrame = 0;
var targetFrame = 0;
var newTargetFrame = 0;
//of course I will have to pass in some of these values(working on that)
//current and target frames are the same
if (currentFrame == targetFrame){
this.stop();
}
//moving backwards from curent to target frame
if (currentFrame > targetFrame){
newTargetFrame = currentFrame - targetFrame;
for (i=0; i<newTargetFrame; i++){
this.prevFrame();
}
currentFrame = targetFrame;
}
//moving forwards from current frame to target frame
if (currentFrame > targetFrame){
newTragetFrame = currentFrame + targetFrame;
for (i=0; i>newTargetFrame; i++){
this.netFrame();
}
currentFrame = targetFrame;
}
Well so much for that I can't figure out what I'm doing wrong .... do I need more code than this? if I set the newTarget to 15 nothing happens
How Do I Loop Through 20 Frames Three Times?
As the title says, all I want to do is play a 20-frame sequence and then loop back through it twice more and then stop.
All the samples I see on the 'net seem too complicated.
I came up with this code, but it doesn't work. Am I close?
/*
i=0;
if (++i < 2) {
gotoAndPlay ("loopBulge");
}
else {
gotoAndStop ("atLoopStop");
}
*/
Refreshing Without Loop Throught Frames
I have done some applications in Flash that require this actionsrcipt in a frame before for exaple I put all of my code in frame 1 and in frame 2 i have:
gotoAndPlay(1); so is like using a loop but I would like to know for example if you can move an object:
on the button
on(press){movlef="yes";}, and in frame 1
if(movlef==yes){object._x=i; i--}
and frame 2: gotoAndPlay(1);
well how can I make move that object without using this kind of loop. I have some applications that use the same technic.
Thanx in advance.
Loop Frames $variable Times
Ok, I need some advanced flash functions, but I am not that advanced yet. But please read further..
I've made a site where people can create quizes. But in html it is not very cheat proof (back button, etc). So I want to make it flash.
I load all variables from this 'file'.
http://www.myquiz.net/game/functions..._mt&framesnr=8 in the flash file.
But the number of questions in a quiz are not one standart value.. So I need a loop, which loads a new question every time (var: question1, question2, etc) when a button is clicked.
The number of questions (thus 'frames')is var: framesnr.
Could anybody help me with this?
Yvo
[Edited by yvoschaap on 05-22-2002 at 03:28 AM]
Having To Place Two Key Frames To Stop A Loop?
I'm in the middle of making an e-card. Everything is working fine, buttons, audio etc etc. I have some animation and some buttons which point to 'play at frame or label' options.
Now - my question is this. I have a button that says 'NEWS' (for example), now when you hit the button it 'go to and plays' frame '10' (for example). Which it does and it has a 'stop' function so it doesn't got any further down the time line and simply plays the movie that is on 'Frame 10'
The thing is, if you hit that button again once instead of replaying the frame 10, it goes back and plays from frame 1, where the original movie began. Stop functions are all in place.
The only way I've been able to combat this is to place a key frame with a stop function on Frame 11 which duplicates Frame 10.
Any ideas?
Thanks
Play Frames In Loop With Code.
Hello all.
In my project i need a code wich allow me to play an animation (not a motion tween)
it is a self hand made animation frames by frames.
my animation start from frame 10 and finish in frame 15.
I just need to play it from 10 to 15 in Loop when my mouse is over.
and stop animation loop when my mouse is out.
i hope i am clear in my description.
thx a lot bye !
Variables Not Updating When Frames Loop
I have been using Flash since version 4.0, and I am a little disappointed with MX 2004 Professional ; certain problems seem to persist that are almost buggy, or poorly documented.
Here's this current problem: I have a very simple script that updates variables in a preloader loop:
if (_framesloaded >= _totalframes){
gotoAndPlay("scene1","begin");
} else {
per= (_framesloaded/_totalframes)*100;
_root.loader._yscale = per;
_root.output=per;
gotoAndPlay("pre");
}
Now, in previous versions of Flash, everything in this script would work. But what it does now....it DOES register variable per for the first time it loops...but the value just stays there. It does not update. I am watching the scrubber in the preview panel and it is in fact looping from frames 1 to 5 until it is finally loaded....then it breaks into the main movie like it should.
The problem is that my _root.output text and my _root.loader bar are not updating while the thing is looping.
So the gotoAndPlay obvioulsly works but the other stuff doesn't. If Flash has changed the syntax for decaring variables, (and I wrote the variables incorrectly) then I should be getting some errors.
Anyway, please excuse the ranting, just think that the simple things in Flash should stay simple.
Sizeing Animation/frames
I already animated a project but I have half of the characters out on the gray. Can I shrink the entire character to the size I want it to be without doing the same frame by frame?
Thanks.
Importing Animation In Jpg Frames
Hello everybody, I have a problem.
I have an animation in jpg images. 100 frames = 100 jpgs.
The problem is, when I want to import that in flash each jpg in separate frame, I have to do that manually. I need to drag and drop each image on stage, and then position it on 0,0px...
It is not THAT hard to do that with 100 frames, but now, I have similar animation with 400 frames, and that would be really pain in the ***...
If there is any other method, how I could do that automatically please help me out here.
I know if I try to import the .avi animation or similar, it would put every frame in separate frame... But I want it to be jpgs...
thanks in advance!
Ivan.
Actionscript: Can You Pause A Loop For A Set Number Of Frames?
The subject says it all I have an array which contains 16 movie clips
references. I want to loop through the array and have it play each movie.
Each movie is 100 frames long. So in english I want
to:
Start at an array = 0
Pause for 100 frames
do an action
load the next movie.
Is this possible?
Drawing Pictures Frames Inside The Loop
Hi Guys
I am killing myself with this loop and nothing...
Now I am trying to draw a frame for each picture that I load in the loop... and my problem is that I can not get the position (_x, _y) for my frames...(they are loading outside the Holder_mc).
I just added a new var for the frame outside the loop, and I scripted a new code inside the loop to call a function that draws the frames and return a clip...
This is my code below, do you guys know why is drawing the frames outside the Holder_mc ?? I attached the frame movie clip into the Holder_mc.... I really do not understand !
var Holder_mc = this.createEmptyMovieClip("holder", 1);
Holder_mc._x = 100;
Holder_mc._y = 500;
var loadMe:MovieClip;
var frame:MovieClip;
var startX:Number = 0;
var startY:Number = 0;
var mc_width:Number = 70;
var mc_height:Number = 45;
for(i = 0; i < numberOfPics; i++) {
loadMe = Holder_mc.createEmptyMovieClip("gready_" +(i+1), i+1);
Holder_mc.attachMovie("frame", "frame_" + (i+1), i+2);
Holder_mc.frame = drawFrame(Math.random() * 0xFFFFFF, mc_width, mc_height, startX, startY);
loadMe._x = startX;
loadMe._y = startY;
startX += mc_width + 5;
var MCL_listener:Object = new Object();
MCL_listener.onLoadComplete = function(target_mc:MovieClip) {
target_mc.onPress = function():Void {
trace(target_mc._name);
}
}
var MCLoader:MovieClipLoader = new MovieClipLoader();
var picToLoad = "ready_"+(i+1) + ".jpg";
MCLoader.addListener(MCL_listener);
MCLoader.loadClip(picToLoad, loadMe);
}
function drawFrame(color:Number, width:Number, height:Number, x:Number, y:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var clip:MovieClip;
clip = this.createEmptyMovieClip("clip" + depth, depth);
clip.lineStyle(1.5, color, 100, true, "none", "square");;
clip.lineTo(width, 0);
clip.lineTo(width, height);
clip.lineTo(0, height);
clip.lineTo(0, 0);
clip._x = x;
clip._y = y;
return clip;
}
|