ActionScript 3.0 :: Using A Loop To Create Buttons That Play MC
Sep 23, 2009
I am trying to basically have a loop that is based on a string length. It adds a movie clip for every letter and a hidden rollover button. All this seems to be working fine but I am having trouble wrapping my head around how to code the event listeners or it might be how I'm telling it which movie to play. As of now all the buttons play the last mc which is block6. What do I need to do differently?
the code within the rollover/rollout function doesn't work. It does work when outside of the function or when the code doesnt use "g".Is this because once inside the rollover/out function it always brings back the last value of "g" ... in this case 20?[URL]
I've surfed through the Internet and can hardly find any tutorial on how to make a slideshow auto play.S3 tell me the syntax of loop play of a slideshow?
I'm trying to create an animation which involves play and pause buttons, i've tried following the tutorial but because my animation is on many different layers it won't work.
I'm trying to create flash rollovers for buttons that play the full rollover animation even if you roll of it, and if you stay on it if will play once and not keep repeating. The rollover animation is only short, about 2 seconds, but which ever way I try it I can't get it to play the full clip if you roll off, either that or it will play the full clip but keep repeating if you keep the mouse on it.
At the moment it is just a movieclip in a rollover keyframe of a button.This has stumped me for years. Other sites seem to do it fine (off the top of my head the 4 menu rollovers at the bottom of http:[url].... do it - if you rollover each one left to right in one go they do a kind of Mexican wave) but I just can't see a way of doing it.
I was looking for a way to create play, stop, rewind and fast forward buttons for an animation I created in Flash. I found a nice description at republicofcode.com/tutorials/flash/controller_bc/, but after trying the code for stop and play I get the error: Access of possibly undefined property onRelease through a reference with static fl.controls:button.
I made three flash presentation for my company some time back in Flash 8, during an exhibition my company want all the three presentation to play in a loop so i opened the fla file of each presentation and inserted the following code in the last key frame of each presentation:
in careerfair.swf I inserted fscommand("quit"); loadMovieNum("college.swf", 0);
[Code]....
I don't know, it is still not giving me the result, on double clicking on the presentation i just see one presentation that quits at the end and the new one doesn't start.
I have a movie in which three balls bounce up and down 3 times and then bounce high and trade places, then they bounce 3 times and repeat.Instead of bouncing three times I would like to shorten it with a loop.How do I tell the movie to loop from frame 156 back to frame 106 three times, and then go to frame 157 and play?
I have the following code on frame 1, which loads 3x swf files into flash and then it plays them over and over.
I want the "ani2" + "ani3" files to standby while ani1 is playing. After "ani1" is finished, "ani2" starts playing and "ani1" loops back to the start but it should not play again. Same thing for "ani2" and "ani3", but after ani3 has played, then "ani1" starts again while "ani2" + "ani3" is on standby again and so on....
The code:
ActionScript Code: var url:String = "ani1.swf"; var req:URLRequest = new URLRequest(url); var myLoader:Loader = new Loader();
I have three flv videos (video1.flv, video2.flv and video3.flv) and I want to play them one after the other (no controls, no skins). When video3.flv is finished I need the movie to restart playing video1.flv again and the rest after it, an endless loop.
How can I do that??
I've tried including the videos one after the other in the time line and in the last frame a gotoAndPlay(1); This works, but the final .swf weights almost 10mb. The project is web based so this is way too heavy.
Now I'm trying the flvPlayback component, but I'm getting quite lost here. I'm importing the three flv to the library. The video implementing wizard shows for each flv but finally I have only one FLVPlayback element in the library. Then I drag an instance on the stage but I don't know how to continue .. Am I doing it correctly? If so how can I continue? Will this method give me a lighter final .swf?
so im trying to get a loop to play the first frame until i is greater than 2.
so on the first frame Im increasing the value by 1
i++;
then on the last frame Im putting a if then statement that if i is less than 2 replay, else goto and stop at the next frame
var i = 1 if (i < 2 ){ gotoAndPlay(1); }else{ gotoAndStop(361); }
now I kinda know whats happening when the second code excecutes its resetting var to 1, so my question is, how do I say once this movie has played once, stop the second time?
I am working on a project which I have to link a few swf. I have used loadMovieNum for the linking, meaning the actionscript I apply for my buttons look like this:
on (release){ loadMovieNum("filename.swf",0); }
Above script enables me to link the files. However, I wish to play an audio across all files CONTINUOUSLY. Is there ANY way to do it? I tried putting the audio in another file and load the movie on level 1. But everytime when I jump from one file to another, the audio stops.
I created a menu of invisible movieclips (from a library item with the class name Invis) with buttonmode set to true so that I can have them send the playhead to different labels on the main timeline.I could use some help with determining which button is clicked and then placing code that executes depending on which button is clicked.Here is what I have so far on frame 1 of my timeline:[code]
I don't have an incredible amount of experience with flash, but I feel like I'm missing something really obvious here. I have about 10 buttons here (although I only show two in my code), and rather than listing out long lines of code, I figured it should be relatively straightforward to put it in a for loop...but its not working for whatever reason.
this loop business is giving me a headache, i can't seem to get flash to recognize functions with a variable in itHere is me doing it the long way and i'm trying to figure out how to do it with a loop.I have 4 buttons going across and i'm trying to create another row of buttons under it, a total of 8 buttons.I also created a sprite called squareBtn
ActionScript Code: //displaying buttons //the difference in X is 34
I have been trying to figure out how to distribute buttons with a loop and I did it but now I don't know what the instance name is to target it.i tried using dog and that doesn't work I tried to set the instances names as _1 _2 _3 _4 but its registered as undefined.
ActionScript Code: var dog:squareBtn; for(var i:int = 1; i < 3; i++) {
i call my disable button function that is inside a for loop? it only ever disabled the last button but i want it to disable them all. Below is my code:
create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked.What I don't understand is how to pull the swf or image file from the file like I have with the text. Truth be told, I'm completely lost and could really use some help fixing this. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
ActionScript Code: var pageXML:XML; //Load the XML file. var pageXMLLoader = new URLLoader();
What I'm trying to do is create a multidimensional array which will pull text, swfs, and/or images from an xml file based on which button is clicked.
What I don't understand is how to pull the swf or image file from the file like I have with the text. I need to pull text and images or the swf file from the xml depending on which button is clicked and I tried to put this together, but I've given myself a headache trying to understand where I went wrong.
Code: Select allvar pageXML:XML; //Load the XML file. var pageXMLLoader = new URLLoader(); pageXMLLoader.load(new URLRequest("scripts/xml/content.xml")); pageXMLLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlIOErrorHandler);
I have several buttons on stage (8), and I want to add a slighty different action for everyone of them. How do I do that, All the buttons always get the last past of the "FOR"..
Code: function loadThumbs(eventoUrl:String) { for(i=1; i<=9; i++) { temp = this["thumb_"+i]; with (temp) { image = "fotos/"+eventoUrl+"/thumbs/"+i+".jpg"; loadImages(image, temp); temp.onRollOver = function() { this.play();}; temp.onPress = function() { this.loadImages(image, image_big); };};};}; loadImages() is a LoadMovieClip type function I created.
I had the following script which worked fine for my buttons which were sitting on the stage and are called 'btn1', 'btn2', etc... However I wanted to animate all the buttons so have put them all into a movie clip called buttons, but now my script doesn't work, I have tried changing all the this targets to _root.buttons.this,
I've created a looping movie in flash which is made up of several seperate swf files and linked together in the main file- it plays fine for the first couple of plays but gradually the timing becomes delayed and slides start to play over one another, is there a way I can have the full sequence play fully everytime?
I am using a mini MP3 player to play an MP3 file. It is working fine, but I need to play the MP3 file in a loop. I have added a variable loop and set it to true but it still doesn't loop.
<script type="text/javascript"> var so = new SWFObject("player.swf", "mp3player", "0", "0", "8", "#ffffff"); so.addVariable("file", "1-05_Concert_ alla_rustica.mp3"); so.addVariable("loop","true"); so.write("flashcontent"); </script>
I am having go with one one of the tutorials here. I am trying to use XML to loop, or play, the list of songs that I have going on. Though, I get stuck with two problems:
1) The Flash will not play the 2nd or third song of the XML file, only the first than it stops.
2) The Flash will also not play the XML file if I embed it on another folder, like for example: I want the flash to be embeded on my home page (so index.php) though I have all my files (songs.xml, the songs, home.as, flash_home.swf) on a folder named /flash/ off my root folder.