I'm an AS2 convert and struggling. I can't figure out how to get my function to see my array. I keep getting an error that "i" is an undefined property.
var thingsToShrink:Array = new Array( b1, b2, b3, b4, b5 );
function shrinkBars(myArray:Array){ for (i=0; i < (myArray.length); i++){ myArray[i]._yscale = 0; }}; shrinkBars(thingsToShrink);
I created a same script of calling my flashvars in actionscript 3. But when I tried to display my flashvar in actionscript 2, its not working. I did the same thing in calling and embedding the swf. But it's displaying undefined..
Here's the block of code... import flash.external.ExternalInterface; import flash.events.Event; var xmlFilePath:String; try { var keyStr:String; [Code] .....
I was just trying to display the value of the flashvar. I tested it in the browser but it's still not working.
So i have my items that I bring onto stage with my loop function with dynamic text fields within the loop. If I want to clear these items using a reset button on the stage how can I do this. From my code below when I press the reset button I receive: TypeError: Error #1010: A term is undefined and has no properties.So a little snippet of my code just to give an idea what I use to bring items to stage and what Im trying to use to reset[code]....
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 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'm trying to make a flash animation but I'm getting these two errors: 1119: Access of possibly undefined property enabled through a reference with static type Class. (line 4) 1061: Call to a possibly undefined method addEventListener through a reference with static type Class. (line 5) This is the code I'm using: Code: Select allimport flash.display.*;
import flash.events.*; stop(); buti.enabled; buti.addEventListener(MouseEvent.CLICK,pla); function pla(e:MouseEvent):void { gotoAndPlay(2); }
My animation is a initial photo that turns around and becomes a black backgroud (were I'll add some text), now what I want is that the photo won't animate until I do a click in it. I used a Layer with a transparent image and converted it to a button and the export name is buti. The other to layers were converted to movie clips named preto and foto.
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'm trying to loop a f4v but I keep getting an error. I have imported a f4v into my library and I now have a FLVPlayback in my library. I have added this to the stage and named it "video_test". I have added the below actionscript to my timeline:
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;