ActionScript 2.0 :: Array Storing An Increasing Variable
Jun 10, 2011i want to make the elements for an array, each one i++.[code]can somone make it work so the array would liik like.ArrayOne = [0,1,2,3,4,5,6,7...]
View 1 Repliesi want to make the elements for an array, each one i++.[code]can somone make it work so the array would liik like.ArrayOne = [0,1,2,3,4,5,6,7...]
View 1 Repliesi want to make the elements for an array, each one i++........so
ArrayOne = Array()
ArrayOne[i] = i
i++
make it work so the array would liik like....
ArrayOne = [0,1,2,3,4,5,6,7...]
I'm trying to create a temperature control box for a flash movie and i have it so that two arrows would control the temp, i can't seem to get them to increase the dynamic text field titled target_temp it sets it fine on the first load but then once I try to click the increase arrow the text field doesn't increase, do i need to reload the movie? here is the code I have so far.
Code:
on(release){
target=target-1;
target_temp.text=target;
}
I am trying to make a simple game where there are five balls that bounce around the screen and speed up at set intervals. You have to dodge them for as long as possible. Right now I have the game set up so that you dodge for 15 seconds and you win - but I can't delete the balls that are bouncing around, and I don't know how to put in a reset button. I have also tried increasing the variable this.speed inside my interval statements but it doesn't work.
View 3 RepliesThis script from MC 1 loads an template from the library and then creates as many instances as the XML says.
It also creates a dynamic variable called ppp. This variable i want to store in each of the newly ceated instances and then use it in another movieclip to load the right path where i want to load another xml file in Flash....
This is what i want to accomplish:
xmlData.load("albums/album"+ppp+"/images.xml");
This code is in another movieclip (MC2) and gets loaded in frame 5 of MC1.
Another soltuions is if it is possible to read the value that is loaded in the dynamic textfield nummer_txt from the template:
Actionscript Code:
[Code].....
There is a combo-box by the name "cbJobs" and it gets its value from the XML file named "data.xml".. I want to store the value transferred from this XML file into a variable.. so basically someone told me to use the code
on (change) {
_root.subject = this.getValue();
}
the only problem with this code is that it gets activated only after I "change" the value in combobox by pulling it down.. I want to use this value obtained from _root.subject as a subject in the script
getURL("mailto:abc@abc.com?subject="+_root.subject);
I have made a variable and am trying to store it as a number that the user enters from an input text field. I am trying this, but it does not work:
var myNumber:Number = myTextField.text;
when i trace myNumber, it comes out blank. How do i get the variable to be the number that is typed in the myTextField?
I am trying to create a navigation where a button is highlighted with a glowfilter when clicked and then unhighlighted when another is clicked. I have this code that I think should be working, but for some reason the variable lastClicked is never assigned and always returns null.[code]
View 4 RepliesI have a movie clip and inside that movie clip there is a button. I will be copying this movie clip 40+ times. When you click the button it must seek out the reference name of the movie clip it is nested in. The point of the script on the button is to make all other boxes but its self vanish. The script needs to know what box it is so it can make all boxes but it's self vanish. I know that _name returns the name of the object the code is on but what about the movie clip the object is in maybe _parent._name?
View 5 RepliesI am doing an AS3 application. In the beginning of my AS file, I need to embed different textures as the following:
Code:
[Embed (source = "./myImage1")]
public var Image1:Class;
I have to embeed n bitmaps. Then I have to create an instance of each oh thease classes.
I want to store the names of thease classes in an array so I will be able to create an instance of a class by accessing the array.
Something like this:
Code:
var arrayOfClasses : Array = new Array();
arrayOfClasses.push(Image1);
arrayOfClasses.push(Image2);
...
Then I want to go through the array and do :
Code:
var variable : Object = new arrayOfClasses[0];
But this dosen't work! How Can I build an array of classes? Is it doable?
I have 15 sets of x and y values, that should be stored together. I was thinking I could have an array, holding 15 other arrays, each holding the x and y value? Is that a valid way to do this? Also, is there a way to create those arrays holding the x and y, dynamically, so they just get numbered?
MainArray[
subArray[x1, y1];
subArray[x2, y2];
[Code]...
Obviously, above is not correct AS. Is this even a way to do this? Are there other much better ways?
I have randomly generated 6 numbers, I need to know how I can store these in an array, and from this array the numbers will be compared with 6 number of another array to see how many balls are matching!
View 2 RepliesI have a few items on the stage with different types of item.
cube_0 ++
square_0 ++
triangle_0 ++
and so forth
I have this scroll bar to rotate each item. When a user click outside of it, it will close down(removeMovieClip) I want to store the last x and y coordinates of [let's say] cube_0 's scroll bar.. so that when a user re-opens the scrollbar, it will be at the last coordinate when they close it.
i am trying to create a menu which is 100% on the fly. the menu item names are stored in a multidimensional array with attatched sub menu items/names. i am trying to create a mc and a txt field for each item in the top menu. i am trying to also store the newly created mc's and txt fields in an array or their own so i can manage the menu motions/tweens better.however, i get several errors, why wont this work?
// ed@goelegant.com
// http://www.goelegant.com
// menu.fla
[code].....
I need to hold a couple of variables in an outside file that can be incremented by user activity -- not just during one interaction with the swf, but with every one.I have no problems with using loadVars and I get the loadandsend process; it is just that I have
no background in cgi or asp for holding the variable and being able to update it.I know I cannot write to a txt file -- that is what I have been using thus far with loadVars for importing values, but this will not help me here. I know it should be a fairly simple script -- I also know I ought to pick up php, but for the moment -- until a greater amount of time comes my way -- I turn to you.
For my calculator i am having trouble storing a number inside a string variable.
[Code]...
Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.
I'm trying to setup a program that loads a set number of pictures (the exact number is stored in resources/data.txt). Pictures are labled picture# starting at 0 and increasing.
My problem is that I want to store the loaded pictures, which is giving me trouble. When I try to trace the bitArray length, it says it is zero..
My Code:
//Variable Initilizing
//Loaders:
var mLoader:URLLoader;[code]....
in php I could do:
$prices['ford']['mondeo']['2005'] = 4500;
$prices['ford']['mondeo']['2006'] = 5500;
$prices['ford']['mondeo']['2007'] = 7000;
[code].....
I've got this code
ActionScript Code:
package uk.ac.uwe.multimedia.lottery{
/*
There are 3 new MCs
1. The instructions "Click here..."
2. An MC with the 2 text fields myText
3. An MC with the 6 input text fields
*/
import flash.display.*;
[Code] .....
Everything works fine until I click on the 'submitButton'. When I click on it nothing at all happens, even though what I want to happen is for the error messages to appear if there is a problem, or if there isn't a problem I want the numbers to be added to the array.
I have just started actionscript after a long break, I am creating a crossword and each box is an 'Input Text' field. Since there are a lot of text fields, I do not want to have to create variables for each text box,I wanted to do something like this:
ActionScript Code:
var inputs:Array = new Array( "_1a", "_1b", "_1c" .. );
for( var i:int = 0; i < inputs.length; i++ ) {
[code]....
I am having trouble storing bitmap images into an array. The following code snippet creates an array called "imageArr" and its intention is to store all the bitmap images in it. The images are captured from the user's webcam and should then be stored in the array. However, when I display the images it can only display the last image taken.
ActionScript Code:
var bitmapData:BitmapData = new BitmapData(video.width,video.height);
var bitmap:Bitmap = new Bitmap(bitmapData);
var imageArr:Array = new Array();
[Code].....
How can I load external swfs, store them in an array, and then have the ability to retrieve any one of them for later use when I want to?
View 5 RepliesThe user inserts 6 different numbers into the input text box between 1 to 49 also i need check if the number is not higher than 49 or smaller than 1 . I also need check duplicate entries and empty space from input text box, which error message will prompt the user. Then i need to store the input from user to array.
Here what i got so far
import uk.ac.uwe.multimedia.lottery.LotteryDraw
var lottoDraw:LotteryDraw = new LotteryDraw();
lottoDraw.chooseNumbers();
[code]....
So I think I have the hang of adding objects in an array to the stage. Now the next step is creating tweens for those objects and calling the tweens when the objects are added or removed from the stage. I'm not quite sure how to do this, especially since I'm using TweenLite. I guess the first thing I don't know how to do is store the tween in a variable for later use. I've tried something likeCode: Select all (var tween1:TweenLite = TweenLite.to(myClip{x:10, y:50});) But this does not store the tween, it activates it. I want the tween to happen later when I call it.The second part of this would be, once I know how to store tweens in variables, how would I add them to an array? Everything I've tried has been wrong. I tried something like
Code: Select allvar tweenArray:Array = []
tweens[0] = [homeTween, homeTween2];
tweens[1] = [aboutTween, aboutTween2];[code].......
I know you don't use addchild for tweens but I'm not sure what the right command is?
I am trying to create a menu which is 100% on the fly. the menu item names are stored in a multidimensional array with attatched sub menu items/names. I am trying to create a mc and a txt field for each item in the top menu. I am trying to also store the newly created mc's and txt fields in an array or their own so I can manage the menu motions/tweens better. However, I get several errors, why wont this work?
Stage.scaleMode = "noScale";
Stage.showMenu = false;
//Global TimeLine Reference
_global.gTml = this;
[Code] .....
I have 3 mc's (clip1, clip2, clip3) and 5 buttons on the stage. When i press button 1 clip1 should go to _y = 100, clip2 _y = -1100, and clip3 _y = -500! The same should happen when one of the other buttons is pressed (with different y values though) My question is can i put the different y values in an Array, and if so how do i do so and how do I call them?
View 4 RepliesI've been trying to figure out a solution for a problem.. Which is really bugging me. The only thing I could think of that has potential to possibly work is being able to store bitmap names in an array.. Like this example(which doesn't work):
Code:
var hairBitmapA:Array = ["hair_1_1", "hair_1_2"];
var i:uint = 1;
var hairBitmap:hairBitmapA[i] = new hairBitmapA[i](0,0);
The idea of this is simple, although not correct, is there a way that I can do what I'm trying to do?
I have a input text field on the first frame. I want to use the data from that text field in the next frame how do i do that using an array or a string.
View 1 RepliesI have a flash assignment that. The assignment is to create an application for playing a card game, I have to create an MXML component that has two variables, one variable stores the image of the back of a playing card, the other variable has t store all 52 options of a front facing card (the second variable will store over 50 images).
I've written the variable for the back of the card image like this:
[Code]...
For my calculator i am having trouble storing a number inside a string variable.
Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.
Code:
var currentNumber:String ="";
function pressNumber(e:MouseEvent):void{
display_txt.appendText(e.target.num);
currentNumber.append(e.target.num);//error here
}