man this site is awsome, i have learned so much. but unfortunantly i have run into a new problem. i have
for (f=0; f<10; f++) { duplicateMovieClip(_root.guy, "guy"+f, f); } for (s=0; s<50; s++) {
[Code]...
only problem is, is that when the movies get duplicated, the numbers aren't right (ive done some testing and found that it is almost as if it is keeping the same variable in all the loops as the same, and is running the loops backwards (wierd)) anyways, apparently i dont know the for loop as good as i thought. i have tried rereading the for explenation, but nothin is clicking as to what i am doing wrong. any help or explenation would be great. (also, as a side question/statement-when i duplicate movieclips, they dont keep thier instante name in the duplicated ones, which is bad becuase i need to do hitTest and other things with the duplicated movieclips. any help with this would be great)
i want to do is loop through an array of items, Each item has an image attached to it. But i only want it to go onto the next item once the image has been loaded fully.I have this wicked code that was kindly donated of someone off this forum.Now i know that this is possible as i've seen it but i'm not sure how to do it.Is it possible to adapt the exsiting codes below to perform this task? this is the code i have at the mo:
step loader:
PHP Code:
function createList(array, i, line, width, count, row) { // if (i == array.length) {[code].......
if i wanted to modify the xy size properties of several pieces of media through a looping function and an incrementing variable how could i do it? resize multi objects through loop & incrementing variable
This is part of a large quiz I am building. The three choices here are part of a group of three from which you should only choose one. If so the other two are enabled=false.I can't change the method only modify since it is part of a much larger app that is runnung fine. So no radio buttons or codeing on maintimeline.
If you run the attached simple FLA and select the first choice you can see the enabled=false that is on the voted and pass framesworks fine, however if you choose the second the first is only disabled and the third is enabled and as logic would have it if you choose the third the first and second are enabled.The idea is to make it so the user can only choose one the other two are disabled while still having the choice to deselect.
This is part of a large quiz I am building. The three choices here are part of a group of three from which you should only choose one. If so the other two are enabled=false. I can't change the method only modify since it is part of a much larger app that is runnung fine. So no radio buttons or codeing on maintimeline. If you run the attached simple FLA and select the first choice you can see the enabled=false that is on the voted and pass framesworks fine, however if you choose the second the first is only disabled and the third is enabled and as logic would have it if you choose the third the first and second are enabled. The idea is to make it so the user can only choose one the other two are disabled while still having the choice to deselect.
I am building a photo gallery in which the images are loaded into a frame_mc and the thumbs are loaded into a movieclip called thumbLoader. The gallery is going to have several categories, every category has its own button and is found on a separate keyframe on the main timeline. When I click the button of a specific category it goes to the appropriate category/gallery. I have a questions:I want to create a horizontal scroll pane for the category buttons but I really do not know the code. For a start, I know I'm going to make the buttons as movie clips, and the scroll pane has to scroll those movie clips. I want to have 2 direction buttons, one that scrolls the category buttons to the right, and the other one to the left.
what I'm trying to do is make a preloader that will preload about 20 external SWF files before it lets you get to my main file. I want to do this because my main file needs the SWFs to be ready to go once its done loading. I have looked around and i found a few ways to do this with the "if (loadedBytes>=totalBytes)" and the code loops back till the files are done loading... this would be just what i need but i cant seem to get it to work. the file just seems to start loading my files but does not loop and just runs the time-line even once i state what frames i want it to loop.
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 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,
In AS2 I used to be able to set up a FOR loop that would program sequential buttons. Now, I'm trying to do it with AS3 and I can't seem to get the function-part right. The last function is the only one that works. Here's some sample code...
PHP Code:
for (var i:Number = 0; i<3; i++) { this["quiz"+i+"_mc"].go_btn.addEventListener(MouseEvent.CLICK, goButtonEvent);
I have this for loop that is basically pulling some info from an xml file and putting it in a list box. And for each item in the xml, it also adds 2 radio buttons.Everything is working properly except all the radio buttons have the same y location, and i want them to be spaced apart, not on top of each other.I have tried messing around with the y location (rb1.y+105, etc) but I'm not having any luck.
for (var i:uint=0; i<il.length(); i++) { lb.addItem({data:il.description.text()[i], label:il.title.text()[i]});
I'm trying to update a series of buttons with a for loop automatically. These buttons will have a somewhat fixed instance names like btn1,btn2,btn3,btn4.My problem is i don't know how to reference the button names with a dynamic variable appended..I have something simple like this, but can someone point me in the correct direction for the syntax please?[code]
It is possible to loop through buttons in a movie clip that do not have sequential names.For instance, they are all named by the date they are for reference to a database.
I'm trying to generate a button with the loop of an array, But I can't make the icon style and the stylename work. for (var x:int = 0; x < smileys.length; x++ ) { var emoticon:Button = new Button(); var label:String = smileys[x][0]; emoticon.width = 24; emoticon.height = 24; emoticon.x = positionX; emoticon.y = 0; [Code] .....
I'm trying to write onPress for 4 buttons inside a for loop. This lines traces undefined: Code: trace(_root.TeachMethodArr1[count]) // undefined. This is because count is no more starting from 0 when I click the buttons.
Code: var TeachMethodArr1:Array=new Array() var TeachMethodArr2:Array=new Array() TeachMethodArr1 = ["a","b","c","b","e"] TeachMethodArr2 = ["a","b","c","b","e"] for(var count:Number=0; [Code] .....
I have is a movie with a button in it called button.i've duplicated the movie (manually) several times on the stage.the movies have been given instance names of movie1, movie2 etc.i've then used actionscript to assign actions to the buttons.i have the following code:
I using a for loop for a redundant action that I want to happen across 5 buttons. OnRollOver the button rotates. OnPress the button moves to a new position. It looks like this:
Code: for(i=0;i<5;i++){ _root.swatch_mc['swatch'+i].onRollOver = function () { this.onEnterFrame = function () {[code]....
My problem is this; onPress I want the button to move up (Ive achieved this already). I also want the other buttons to move down onPress (this is my problem). Is there a way have the other 4 buttons move down onPress using the for loop? Or is there another method of doing this?
I have this little loop that creates buttons. My aim is to change value of variable 'thevalue' on everytime button is pressed, first button should give value 0, second 1, third 2 and so on.
Code: for (jo=0; jo<xmlData.firstChild.childNodes.length; jo++) { value1= xmlData.firstChild.childNodes[jo].attributes.value; _root.attachMovie("button", jo, (1000-jo), {_x:20, _y:20+(jo*20)});