How To Load A Second Movie While The First One Plays
I have a series of kid's songs in seperate .swf files. Each one ends with a loadMovie command to play the next song. The last one loads the first one again.
I'm using Flash MX and am wondering if there is a way to have the next song downloading while the current song plays. I would like it to appear to be one continuous program, but now it stalls at the end of each song so that the next one can begin streaming.
Thanks,
Jim Patton
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-26-2003, 01:11 PM
View Complete Forum Thread with Replies
Sponsored Links:
Load Movie, Only Plays Once--help
(I have Flash 4) I have a movie that is a menu system. In that movie, I have a layer with an empty movie clip called dummy (instance). With an onRelease mouse event of a menu button, I load an external movie into the "dummy" instance, then use a Tell Target command to play the movie. I have a stop action in frame 15 of the external movie, because I don't want it to disappear until one of the menu options or the close button is clicked.
When I click the menu button, the external movie plays but disappears right away. Also, I can only get it to play once--it won't play each time the menu button is clicked like I want it to. I've tried different tutorials and looked everywhere, and I don't understand why I can't get this to work. I am getting all confused, can anyone please help? My example is (please click the Tours button):
http://www.hcc-al-ga.org/pilot/intro3.html
View Replies !
View Related
Load Random Movie, Randomly Plays Next
I am using the load random movie script: (http://www.kirupa.com/developer/acti...ndom_movie.htm)
with no problems. I would like to add some functionality to it though. How would I make it so once the movie loaded plays, it will play another movie from the array, but picked randomly as well?
View Replies !
View Related
[MX04] Rollover One Movie Clip Plays It, And Plays Another. How?
Alright, so I've got two movie clips.
I have one, called fade_mc, which will play on rollover, and then play in reverse on rollout.
Here's the code for that, placed on a separate layer in the MC.
PHP Code:
stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
What I would like to do is add to this so that, upon rollover of this MC, other movie clips will play in a similar fashion, and play backwards upon rollout.
In this case it is a MC called dark_mc that I would like to have play.
Posted this in the newbie section to no avail, please help!
View Replies !
View Related
Help - Flash Movie Plays Fast By Itself, But Plays Slow When Loaded Within Another Flash Movie
I have a flash website which I tried to update recently. In particular, I am updating my photo gallery which I load within another flash using loadMovie. Before updating it, everything worked fine. The update is not completed yet, but I notice that my photo gallery is playing extremely slow compared to before. I did add some new graphics such as fading in and stuff like that, but nothing serious. If I played the clip by itself, ie. typing in the actual photogallery.swf, it plays at full speed. When I run the photogallery through my regular website, meaning loading it through loadMovie, it plays very slow. The photogallery.swf is only 58k in size, so download speed shouldn't be the case. Nevertheless, I tried adding a IfFrameLoaded just in case but that didn't solve my problem. Anybody has any ideas why it might be playing slow when I'm using the loadmovie function and plays fine when I just reference it directly?
View Replies !
View Related
Load Swf But Then Swf Only Half Plays
I have a loadMovie call to an external swf. That swf has close to no actionscript, maybe a beginning play on first frame and stop on last.
The problem is that it stops in the middle of its timeline after its loaded into the larger swf website.
What are some possible glitches that would cause a swf to freeze up in its timeline after being loaded into a larger swf?
(it does this at the exact same place every time, but again there is no actionscript at that moment in the timeline)
Thanks.
View Replies !
View Related
Animated Button Plays Once Upon Load
(Flash MX 2004) I have created an animated button. On the "over" state, I have put an MC that flashes white. Works okay, except it flashs once immediately when the .swf file loads for the first time. I do not want it to flash till the cursor rolls over the button. I put a "stop" in the first frame, but then it will not play at all. When I delete the "stop" it plays once automatically. The mouseover works correctly, because I have a "stop" in the last frame. But how do I get it not to play once on loading. I tried the repeat "0" instead of once, but it still plays.
View Replies !
View Related
Sound Plays On Load Repeatedly
Hi, I'm trying to make a basic music player for a portfolio that allows you to switch between 3 tracks, change volume and mute the tracks, so far I'm only just trying to load the sounds and play them but already have a problem.
The sound seems to play, then start again over itself, building up until it's a garbled mess. Code I have is here:
Code:
var soundReq1:URLRequest = new URLRequest("dev_files/track1.mp3");
var soundReq2:URLRequest = new URLRequest("dev_files/track2.mp3");
var soundReq3:URLRequest = new URLRequest("dev_files/track3.mp3");
var track1:Sound = new Sound();
var track2:Sound = new Sound();
var track3:Sound = new Sound();
track1.load(soundReq1);
track2.load(soundReq2);
track3.load(soundReq3);
track1.addEventListener(Event.COMPLETE, track1Play);
function track1Play(event:Event):void
{
track1.play();
}
Do I have to add something to stop the track from playing everytime track1Play completes loading? I'm following Lynda.com tutorials for this and this code is pretty much exactly the same to what was in the tutorial.
View Replies !
View Related
Load Site Whilst Intro Plays
I have created a site that takes around 20 seconds to load on std dial up, so i created an intro movie which comes up right away to keep my visitor interested whilst my site is loading.
How do i get the second movie to load behind the first so that when the first finishes and quits the second movie is running behind and comes into view?
Can any one help as this would be a real life saver ?
View Replies !
View Related
MC In .swf File Plays Slow... Did The Preloader Load It?
Hello.
I'm old time art director struggling with this site I built. 1st full site ever.
Here it is...
http://www.fizzcommunications.com/
Client has asked me to speed up 'flying words'. I build it at a speed I like, but then the intro s l o w s d o w n when played over the net.
Here is my attempt to "speed things up".
http://www.limeball.com/index2.html
(Still runs at 1/2 speed of that which I built)
I'm suspecting the preloader isn't loading it... or something.
Or something like, I built a monster, and I'm asking waaay 2 much of any browser. I followed most instructions found on the web 4 fast play.
• consists only of outlines
• no fonts
• no bitmaps, .png, jpeg or any pixel content
• I eliminated an alpha fade at the end of each word
• I grouped things where I could
• I'm working at 24 frames a second (I like 30)
I'm thinking now 2 things left...
1). I need an action script to move the words, rather than graphically.
2). I need a better preloader to load content rather than frames??
I dunno...
View Replies !
View Related
Flash Video SLOWS DOWN WEBSITE LOAD, Plays Choppy
Hello,
I am a designer that has encoded .Mov files to .Flv in CS3 Flash Video Encoder. They look and play great when previewing on my hard drive, but once uploaded to the development server, the pages load much slower and the video soemtimes stops & lags, like it is waiting for it to load.
Encoded On2 VP6, Progressive, 246kbps video, 64kbps audio; resized to 320x240. I create the pages in Dreamweaver CS3 and insert the Flv video in it. File sizes range from 5mb-13mb. There are a lot of videos on this website, approx. 20, but only one per page. Do we need a Flash Video Hosting service? The site will be hosted by godaddy.com.
Here is the temp site: www.wondernumber.moonkids.com. I thought this would be handled by a programmer, but got stuck in my lap. The webiste is done except for this problem. Any help offered is greatly appreciated!!!!!
~Jana Yeakel
View Replies !
View Related
MP3 Player On Website-Plays Approx. 5-10 Seconds Of Song Then Restarts And Plays Thru
Hello,
I have an MP3 player that I have tweaked and modified on a website of mine for a friend.
Everything works fine--but it seems it will load a song and start playing 5-10 seconds of the song then restarts the song and plays it in full. Anyone have any idea why this would be happening?
The MP3 player is at www.peeler.ca and will start as soon as you get inside the website.
Could someone have a look and listen and see if you have any ideas?
I imagine it is some redundant code or something small. It is very annoying....
Thanks in advance...
View Replies !
View Related
MP3 Player On Website-Plays Approx. 5-10 Seconds Of Song Then Restarts And Plays Thru
anyone have any ideas as to why my player would play like 5 seconds of a tune....then restart it and play thru completely?
I was told maybe interval coding....but not sure what I am looking for....nothing appears to jump out at me.
I will upload the .fla source code and maybe someone will see something I dont- Or you can check out what it is doing on the website www.peeler.ca the player will start on its own as soon as you get in the main page of the website.
Any help is appreciated...I am stumped!
View Replies !
View Related
[F8] Intro Page, Continuing Movie After External Movie Plays
I have a question.
I am creating a new flash page for myself and I am trying to create an intro page where an external video plays in a player, )it is called implicitly to the player), and then after the external movie plays, then the SWF continues doing its thing automatically..
This is what I have so far, I am trying to pull the time of the movie vs the duration of the movie and then have it goto the next frame
//Get Duration of movie clip
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
end = ns.time / duration;
if (end = "1")
gotoandplay(9);
my concept is sound, I know what i want to do, but I dont know how to go about it..
Gracias in advance!
View Replies !
View Related
Rollover Plays Frames 1-5 Of Movieclip, Rollout Plays 6-10
Need help on this, i'm sure it's the most basic thing, but haven't found my answer thru the help files, etc !
I have a button which on rollover i need to play one of my movie clip animations from frame 1-5 (i have a stop action on frame 5), and on rollout i need it to play the rest of the animation (6-10).
at this point, i simply dropped the animation onto the 'over' state of the button, but don 't know where to go from here, if not back to the drawing board.
the button is called 'button1' and the movie clip is 'animation'.
if it's better to do this with an external movie clip, i'd be cool with that, too.
thanks for the help
View Replies !
View Related
Test Movie Plays, Movie Doesn't
I`ve made a menu for viewing several swf in the same scene, with loadMovie. When I click on test movie, they play perfectly when I push the button. But when I export it, nothing happens when clicking the button.
Anyone knows why it can be so?
Thank you.
View Replies !
View Related
Movie Only Plays Once When.....
When this action script is executed from a button:
on (release) {
gotoAndStop (56);
}
It plays the movie on frame 56. The movie plays and stops. But when I click on the same button again, it wont play the movie again. Any hints??? Thanx in advance!
View Replies !
View Related
Movie Just Plays
Ok, this is the most noobtastic question in the world, but.
How do I get Flash to stop at the first frame so I can have a start button, I used to make flashes all the damn time about a year and a half ago and now I cant remember crap
View Replies !
View Related
Preloading Movie While Another Plays?
Hey. I have a main MC that is quite large. I created a separate .swf that holds my loading screen animation. Is there anyway to pre-load the main MC while the loading screen .swf plays, and then when the main MC is finished loading, to load the main MC on top of the loading screen .swf? I hope this makes sense... I've been trying to figure it out all night. Any help woul dbe greatly appreciated.
cheers
john
View Replies !
View Related
Movie Plays Randomly
Hey guys.
How can I make a movie play randomly...example...something flashes randomly, or grows and shrinks randomly, without anyone rolling over anything, and without it being constant like every second. ! second it flashes; next time it flashes maybe 10 seconds passes, then maybe 3, and so on... TOTAL RANDOMNESS.
Thanks. By the way, Im new at this so please be gentle.
View Replies !
View Related
Stopping A Movie Before It Plays
Hi,
I'm trying to stop a movie before it plays. I added a layer and on frame 1 I put in the actionscript code: stop();
When I test the movie, everything is stopped, but one of the sounds still plays. What do I need to do to make sure the sound doesn't play?
Tanya
View Replies !
View Related
Flash Movie Plays Once
Hello,
I am wondering if it is possible to do the following:
(1) A person goes to my home page;
(2) On the top of the page is my flash movie with my logo and business name;
(3) Flash movie plays and at the end, stops, leaving my logo and business name the way it looks at the end of the Flash movie;
(4) Same person goes to other pages in my website and at the top is simply a JPEG of the last scene of the Flash movie;
(5) Same person goes to my home page again, but this time I do not want the Flash movie to play.
I can do Nos. 1-4, but can someone help me with step 5?
Thank you,
edsager
View Replies !
View Related
Fussy Movie Plays Only For Some.
Hello,
I have produced a Flash MX (not 2004) movie which I dropped into an html page. It is an interactive quiz and works perfectly well for some people (including myself, on multiple browsers) and yet for other people, it skips right through to the end of the movie without stopping in the appropriate places. However, people who have this problem also find that the movie performs as it should when operated for a second time.
I have the action layer top now (in was under the buttons before) but it still has the same problem.
I have Flash 6 player.
Can anyone suggest what might be causing this problem?
Diputs
View Replies !
View Related
Movie Plays Slow
hi there i do hope you can help me
i have pieced togeter 30 photos to create a little animation.
it's set at 35 fpm however when i test the movie it initially plays really slow and jumpy
if i play the movie a second time it runs perfect - how do i get it to run perfect first time?
cheers
View Replies !
View Related
Plays On Stage But Not In Movie
Working on my first banner. It views properly on the stage (Control-Play), but when I Export and/or Test the movie, it’s not the same thing. I only set up transitions and transformations on three dynamic text lines. Also not sure if text is large enough for this banner. What step(s) am I missing? I’ve saved multiple (6) versions, but still the same. PLEASE HELP! What must I do to save properly and send to recipient?
ALSO, spelling should be ArtZone 360 Graphics. In other words, I can't get into the text to capitalize or put spaces in. What now?
View Replies !
View Related
Movie Plays In Flash But Not SWF
I've got a college assignment due in but I'm having real trouble getting the video to work. It's a 3D Animation/Flash blend so I've linked the video (.mov) to play in the first scene and then it proceeds to an interface (similar to DVD menu screens playing a clip then going to the interface)
The video file appears perfectly in flash but when I publish it to a swf file all I see is the background colour. I've been stumbling through this project and really really cant seem to get it finished so I'd really appreciate it if anybody could give me some pointers.
Thanks,
Toasty
View Replies !
View Related
All Sound On/Off - But Movie Still Plays
sorry to do this...trying to get a CD out the door right now (12:27am-NYC) and I searched on this and all the threads are turning up complex answers.
Isn't their some simple command that just cuts all sound output from Flash??! - I want to mute everything or nothing while a movie keeps playing, and given that I have dozens of sound files in my movie I would really really really rather not go through the whole thing attaching functions to all of them.
Thank you very very very much in advance!
View Replies !
View Related
GetURL AFTER Movie Plays
i'm trying to play a .flv file that is called from within a .swf
i've got that part working using flash by just importing the video into scene 1. it plays the video.
now when the video has finished playing -- and not until then -- i then want to do a getURL to splash.htm in order for the viewer to be taken to another page on the site where there is a nice looping graphic for them to see but only AFTER the video has finished playing
i don't know where to put the getURL. i assume i'm not expected to figure out precisely on which frame number the movie is going to finish playing and put the getURL there right?
isn't there a way for it to do the getURL after and only after the .flv movie has finished playing, whenever that may be?
as it is now, it does the getURL before the video has finished playing with the frame i've got it on now or if i put the getURL in the next scene it just does the getURL before the video has had a chance to play through
is there a way for it to know that the video is playing and not launch the getURL until it's done?
i'm looking for a way to do this using the guided script, i don't know code
View Replies !
View Related
Preloading 2nd Movie While 1st Plays
I have two movies, Animation01.swf (30K) and animation02.swf (2MB). Additionally, I have a preloader movie, preloader.swf.
What I am trying to do is from the preloader.swf is to load the first move (Animation01) and as soon as it finishes loading, to play it. While Animation01 is playing, I'm trying to preload Animation02 in the background. Animation02 must only begin playing after the first one finishes.
On the first frame of Animation01 and Animation02 I have a boolean variable donePlaying set to false. On the last frame of each animation I set the donePlaying variable to true so I can access it from the preloader. I am doing this (incorrectly?) to know if the current movie has finished playing so I can start playing the second one.
I have searched high-and low and have seen discussions on what is almost the same problem/solution. From these discussions I have created the code below. What is happening right now is that I can't seem to call moviesLoaded[0].play()... Meaning that nothing plays. If I remove the targetMc.stop() from inside the onLoadComplete event handler, then both movies play right away atop each other :(
Attach Code
var firstMovie :String = "Animation01.swf";
var secondMovie :String = "Animation02.swf";
var moviesList :Array = new Array(firstMovie, secondMovie);
//-----------------------------------------------------------------------
function PreLoadMovies() :Array{
// Array to hold the movies loaded
var moviesLoadedIndex :Array = new Array();
// For every movie in the moviesList...
for (var i:Number = 0; i < moviesList.length; i++) {
// Create the empty MC container and hide it.
var container:MovieClip = this.createEmptyMovieClip("container"+i, this.getNextHighestDepth()+i);
// Create listener for events
var listener:Object = this["listener"+i] = new Object();
// Event handlers
listener.onLoadStart = function(targetMc :MovieClip){
trace(targetMc._name + " has started loading");
}
listener.onLoadComplete = function(targetMc :MovieClip){
trace(targetMc + " has finishd loading");
targetMc.stop();
}
// Create MC loader and bind the listener to the loader object so it can listen to its events.
var mcLoader:MovieClipLoader = this["mcLoader"+i] = new MovieClipLoader();
mcLoader.addListener(listener);
// Load the movies and add it to our index of movies finished loading
mcLoader.loadClip(moviesList[i], container);
moviesLoadedIndex[i] = container;
}//end for
return moviesLoadedIndex;
}//end PreLoadMovies
// Call the function to preload the movies
moviesLoaded = PreLoadMovies();
// Gain access to movies loaded.
trace("I have access to " + moviesLoaded[0]._name);
// Check access to the movie's "donePlaying" boolean variable.
trace("Has the first movie done paying? " + moviesLoaded[0].donePlaying);
// Play the first movie
moviesLoaded[0].play();
if(moviesLoaded[0].donePlaying = true){
// Hide the first movie
moviesLoaded[0].hide = true;
moviesLoaded[0]._x = -1500;
// Play the second movie
moviesLoaded[1].play();
}
this.stop();
Edited: 10/03/2007 at 01:08:19 PM by ={0_0)=Musashi
View Replies !
View Related
Can't Unload Movie, Still Plays In The Bg. Please Help
Okay, so first off let me thank you in advance to whoever will help me with my dilemma.
Here is the site that i am currently working on http://www.luis-am.com/site_main/index.htm
Now, what i can seem to get working is the unload movie, like for example clicking one of the menu items, the next swf will load on-top of the main swf but the main swf will still be accessible in the background.(i like the way the new movie fades in, so i would like to keep that effect if possible) ( i have 3 separate swfs, the 1st one is the content loader swf which will load the main.swf and that main.swf is suppose to load any corresponding swf when the user is to click on any of the menu items)I haven't been able to figure it out and i've run out of ideas on how to do it. Can anyone please be so kind to point me in the right direction or to just give me an example of how it should be done.
Thanks!
View Replies !
View Related
Preloader Plays Over My Movie
I have a preloader set to play while an external SWF file loads. The preloader plays but it keeps playing after my movie has loaded and plays over the movie. Can anyone help????
This is the code I have:
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListner:Object = new Object();
mcLoader.addListener(myListner);
myListner.onLoadProgress = function (target_mc,bytesLoaded,bytesTotal) {
extLoader_mc._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
if (bytesLoaded >= bytesTotal) {
extLoader_mc._visible = false;
}
}
mcLoader.loadClip("introShow.swf",myLoader);
View Replies !
View Related
Counting Movie Plays
Hi peepz!
I have a simple movie that once run loops ad infinitum and adds to a counter on the stage incrementally each time the movie loops. I'm looking for a way to store the number of the times the movie has run server side and pass that number back to flash, so that when the movie is loaded again it would start from the new number stored + refresh the number count at a given interval during play back if more than one person is viewing the movie at a time.
Something like a hit counter but for the looping movie and not the page load.
Good greef! now that I've written it down in words it looks even more difficult. :?
Note: The refresh part of the question is'nt all that important, it looks like an extra level of complexity my brain simply couldn't handle.
thanksInAdvance();
View Replies !
View Related
Wait Until Movie Is Preloaded Before It Plays
I have a problem making an external .swf loaded with loadMovie to stop until all of it has been downloaded an then play it. I am loading it into a mc in the mainMovie.
This is the code...
onClipEvent (enterFrame) {
loadMovie ("afghanistan.swf", "_root.afghanistan");
_root.afghanistan.stop ();
}
onClipEvent (data) {
if (_root.afghanistan.getBytesLoaded() >= 450000) {
_root.afghanistan.play ();
}
}
Anything I can change to make it work?
View Replies !
View Related
Stop A Movie After It Plays To A Certain Frame.
I have Flash 5.
I have a weather barometer, which I want to move up and down depending on changes in the temperature.
The movie is 100 frames long, 1 frame for each degree.
How can I get the barometer movie to play upto the current temperature, and then stop playing when it reaches the currect temparature?
Thanks.
View Replies !
View Related
Sound Plays Before Movie Is Ready
I have a flash movie that has actions and music. At particular times
the actions are Synchronised to the the beat of the music .
However sometimes when I preview my movie in a browser (F12), the
sound loads first and plays slightly earlier than the action, making
the spoiling the synchronisation. When I refresh it, it then appears
fine.
How can I make the sound only start playing once the actions are
ready?
View Replies !
View Related
Movie Plays Over Buttons That I Don't Want To Activate
So what happens is, I've got this navigation bar that when you rollover a link, it activates a movie to drop down another set of links. The problem is, when that new set of links drops over the bottom layer of links, I end up activating more than one button (link) at a time. Is there some kind of script that says, 'while this movie is active, nothing else can play' ??? Any help would be greatly appreciated!
View Replies !
View Related
Movie Plays And Stops For 20 Seconds
Heya. I feel like I should know this by now however, I'm having one of those days when I can't think straight!
I've got a button that when 'rolled over' it plays a movie clip that 'stops' at the end. I need it to stop and then continue after 20 or so seconds. I've tried adding some time variables, but I think I'm doing it wrong. Any suggestions???
Thanks in advance!!
View Replies !
View Related
Movie Plays In I.E. But Not In Netscape Or Opera... Help
This is scary...
I have an intro movie at http://ambaji.com.au
It works fine in IE5 Opera6.1 and Netscape6.
There is a link 30 sec into this movie that goes to a full music version of the same movie.
IE runs it fine but Opera and Netscape just freeze on what may be the blank first frame of the new movie. Arghhh!
I dont know if this has anything to do with the new movie being set up so that it loads layer 1 and then calls for a much larger (1150kb) movie in layer 2. As I said it works fine in Internet Explorer though.
I cant think why Opera and Netscape would handle the no music 760kb version well but balk at the 1150kb 2 layered music version.
Any clues anyone??
Thanks
View Replies !
View Related
Preloader To Bring 5%-20% Of Movie Then Plays
Who knows how to make a partial preloader work.
Have code from df's book but reducing if(framesLoaded >= 90){
does not reduce amount before starting movie.
Also preloader progress bar and graphic do not appear until 32% into movie. Can anyone out there help?
onClipEvent(enterFrame){
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
framesLoaded = Math.ceil((loaded / total) * 100);
gotoAndStop(framesLoaded);
status.text = framesLoaded + "% completed";
if(framesLoaded >= 90){
_root.gotoAndPlay("main", 1);
}
}
thanks chaps
View Replies !
View Related
Movie Clip Plays - Despite Condition
I have a movie with 2 buttons - button1 and button2.
Each button is a movieclip and consists of 2 layers :
Layer 1 contains an 11-frame animation which fades
the text "button 1" up and down through tweening
the alpha from 30 to 100 and back to 30 again.
Layer 2 contains a button with alpha set to 0, this
button spands through the entire animation. The button
is assigned actions that moves the playhead to the
appropriate locations in the animation, when on(rollOver)
and on(rollOut)-events occur; making the text "button 1"
light up when the mouse goes over it, and fades it out
to alpha 30 when the mouse goes away.
This all works very good, but I also want to keep the button
"turned on" when I press it. So I create another layer in my
main movie - on top of the layer with the button in it.
In this layer I create a movie clip with the text "button 1"
in it, and make 2 frames; frame 1 with the alpha set to 0 and
frame 2 with the alpha set to 100 - both frames are assigned
the stop-action. I call the instance of this movieclip "button1On".
Now when the on (press) event on button 1 occurs, the actions
in button 1 tell the playhead in "button1On" to go to frame 2 -
and "turn on" the button by setting it to alpha 100. This works
well too.
Now comes the problem :
I want to have another button in my movie ; "button 2" and I want
thís button to do the same thing as "button 1" - no problem, I
create another button. However, if "button 1" is turned on -
(which means that the playhead in the movieclip "button1On" is placed in frame 2), then I want the on (press) handler in "button 2"
to turn "button 1" off. So I assign the following script to button 2:
on (press) {
if (_root.button1On._currentframe = 2) {
_root.button1On.gotoAndStop(1);
}
}
Great! - It works! - when "button 1" is on, and I press "button 2" -"button 1" is turned off!
Now let´s spice it up a bit: What if I want a little animation to play, when I press "button 2", say...an animation showing "button 1" slowly turning off? Well..I make a movieclip showing a fading "button 1" I place it on a separate layer and name the instance of it "button1TurnOff" and I am ready to go!
Hey!
Wait a minute!...naturally this animation should only play if and ONLY if "button 1" is on - so I include the script to play "button1TurnOff" in the if-statement - the script in "button 2" now looks like this:
on (press) {
if (_root.button1On._currentframe = 2) {
_root.button1On.gotoAndStop(1);
_root.button1TurnOff.gotoAndPlay(2);
}
}
This also works: When "button 1" is on, and I press "button 2"
"button 1" not only turns off, but the animation "button1TurnOff"
plays as well! The only problem is....when I press the "turned on" button 2, the animation "button1TurnOff" plays again!???
How can this be?? The if statement checks to see if
"button1On" is in frame 2, which it isn´t, because we set the playhead to frame 1 with the first press on "button 2"?? But this condition is ignored and the clip "button1TurnOff" plays again?
Can anyone explain this?? Please!!
P.S: I included the .fla for you to see!
View Replies !
View Related
Movie Clip Only Plays 1 Frame
Hi all,
I have a mc of 50 frames inside a parent clip of 1 frame.
The Parent clip is loaded onto the main stage when a button is pressed using attachMovie().
Now, when a second button in the Parent clip is pressed, I want the tween to start on the child.
I'm doing this like this:-
Code:
//code attached to child clip, inside the parent clip.
onClipEvent(load){
gotoAndPlay(2);
}
It all works, except the fact that the child's clip animation stops at Frame 2 and doesn't play the other 48 frames!
Any ideas?
View Replies !
View Related
|