ActionScript 2.0 :: Flash 8 - For Loop Not Working
Feb 24, 2007
I am having some trouble with some code. buttons are not working.
Code:
menuLoc = new Array("menu_main", "menu_philosophy", "menu_portfolio", "menu_resume", "menu_contact");
for(i=0; i < menuLoc.length; ++i){
_level0.navMenu.menuLoc[i].onRelease = function() {
trace("hit");
}}
The array has the instance names of the movieclips which are located in navMenu.
I have a project I am working on in Flash CS3 using AS3.I have a drag and drop quiz that contains 8 boxes. 4 of the boxes contain dynamic text boxes with the vocabulary words. 4 of the boxes contain the definitions to the vocab words. The students drag and drop the vocab words onto the definitions. My issue is that hitTestObject is only working on the first box everytime. I have a for loop in my endDrag code that should loop through each object and test against it to see if there is a hit. Can anyone see anything wrong with my loop?
I create 30 text fields dynamically on the stage and want to set text format for all text fields. I use 'setTextFormat'. It works fine for single text box. But not working if I give this in loop. See the code below. It creates thirty input text boxes on the stage. But it assigns text format only to the last text box. When code Copied and placed in frame 1. The stage size should be 800 x 600. Execute the program and type in the last text field. I want that to happen for all text boxes.
ActionScript Code: var xtpos:Number = 10; var ytpos:Number = 10; var i,j:Number=0; var depth:Number = 100 var k:Number=0; [Code] ..... In the above it traces only the last text field.
I'm trying to create a "for" loop to load thumbs into existing movie clips using the following code:[code]This should load thumbs 9-17. The trace shows the variable is incrementing but I'm not getting the thumbs to load.
I'm loading a variable from a .txt file into flash (per client request).The variable is as follows &ClientNumberOf=4 so the variable = 4, this works on trace, happy, joy When I try and add the variable to my for loop..[code]I've tried a slew of different options...(for example)var newVariable: Number = ClientNumberOf; Nothing works, again, trace works, but script fails to work when I try and dynamically set the loop?!
I'm very new to Adobe Flash CS5.5. Can you create a common instance EG: "Enemy" and then control it like so: Enemy.x += 1; So that all instances of Enemy will move forward one pixel each frame? Instead of just one enemy? If this is not possible could I set up some sort of array of enemies like you can in C and try something like: int EnemyNo = 1; for(EnemyNo = 1; EnemyNo < 5; EnemyNo++) { Enemy[EnemyNo].x += 1; } Does Flash even support "for" loops?
In the following code, I create 12 buttons, label them, and control their onRollOver,onRollOut, and onRelease actions. Everything is working fine except for the line containing the "slideTo" method. Reading from the two arrays for the x and y values, it appears to be inserting the largest number in each array instead of stepping through all 12 values. Currently, clicking on any of the buttons moves the object (ralphMC) to x=100 and y=800. I am pretty stumped about this, as I've inserted quite a few various numbers into each array during testing. Can anyone tell me what I am doing wrong?slideTo is part of the mcTween package, in case anyone wanted to know. code follows:
Code: //Creates an array of numbers that will evenly space the buttons out vertically var mcPosY:Array = new Array();
i'm trying to check the passwords and names and i want it to goto the next frame if they match, security isn't really an issue so i'm not going to go through php and mySQL and stuffhere's the code:
i have attached the flash file and also xml file. Here i duplicate the movieclip, first for loop is working perfectly but inside of second for loop is not working properly.
i have attached the flash file and also xml file. Here i duplicate the movieclip, first for loop is working perfectly but inside of second for loop is not working properly.
The problem is my buttons stop working after a certain point. Now I think it's because I need some kind of loop somewhere, but I'm not too sure. I've included a trace in the code so I know the button is not working anymore. (At least the function of what I want it to do).
I have a class file that contains a for in loop. basically there are 50 states (movieclips) on the stage and here is what I have:
[Code]...
I don't think I understand enough about arrays or for in loops to understand why this isn't working... it traces the array, but not statesArray[states], and it doesn't change the alpha of anything.
As the title suggests, I cant get function at end of the code to attach to each MovieClip I create dynamically within a loop.Only the last image will follow the mouse. What am I doing wrong? Im really not sure.
Code: //now do something with the xml data PopulateLists = function(final_array)
How can i change movie clips apha property slowly one by one in for each loop? I can't undestand what's wrong((( From XML data i create for each loop, where my MC creates. But i can't chang their alpha property slowly. When i'm trying
Code: mc.addEventListener(Event.ENTER_FRAME, alphaShow) function alphaShow(e:Event):void{ e.target.alpha += mcAlphaPlus;
I have the following which works fine just out side of the loop statement:
loadMovie("icons/test.jpg", "pIcon0.Icon");
But inside the loop statement no image shows up.
I need it in the loop statement because eventually the code will call the jpgs out of an array based on the loop variable. And put them in a movieclip number by the variable also.
I'm trying to have my program select from a random assortment of pictures in the file, and each one is labeled Transition1, Transition2 etc. Each instance of the symbol is named transition1, transition2, though 4. The 4 symbols are in one other symbol with the instance name TransitionImages. For some reason when I run the program it doesn't put the files in the symbols though
stop(); var checkNumberArray:Array=new Array ; var transitionimageLoader:Loader;
This is an if stament on a frame on the root. I want to loop Carrera(a lenghthy movieclip) from frame 2 back to frame 1. (For testing purposes) This is the code:
I have a for loop updating a dynamic text element but it seems to iterate so fast that only the last item in the loop is updating the text. I'd like the dynamic text element to be updated with EACH item in the loop, not just the last.
1. I have a single frame movie where I create a simple array of strings from an external text file:
I have a flash project, its working fine in local system, but the same file is not working in live here is the link of the site, its showing blank page, the flash contents are not loading... [URL]
I have a flash project, its working fine in local system and checked this file with uploading in someother websites, its working fine there too, but the same file is not working in live here is the link of the site, its showing blank page, the flash contents are not loading.URL...and here the same file which i have uploaded it in other server its working fine.URL...
I have developed a player in AS3. It is working if i provide the IP of the website. But, it is not working when i provide the full domain name. Even, i provide the crossdomain.xml for global access.
i have a "swf" file which is picking url from xml & displaying the image, when i tested it locally it works fine, which means it picks up URL from XML & displaying corresponding image. After i uploaded it on server, it doesn't show anything.
I created a 9-scalled background in Flash CS5 which is working fine in Flash CS5.But when i imported it as embeded graphic in Flex, and change dimensions in runtime, 9-scalling doesnt work.Here is my code.