I am trying to make a hangman game and have made an array with words and picked one at random each time the movie is run and then taken that word and broken it apart into each letter. I then made a loop to create a new TextField for each letter. Then I set them all to "visible = false"I want to get to the point where if the user selects a letter that is in the word that that TextField with said letter will become visible. Only I cannot figure how to get a function outside of the loop to see the variables (i.e. instance names of the TextFields) inside the loop.Here is my code:
ActionScript Code:
var words:Array = new Array("HELLO","WORLD","JOE MAMA","ALIENS","ATTILA");
var letterArray:Array = new Array();
I'd like to have my movie clips on the stage and run a loop to return their x and y positions, these positions will be stored in an array (startPos:Array) for use later in some other script. I have 7 movieclips on the stage, each with an instance name startobj[a number]
AS2.. Nice all works: var numberOfElements:Number = 7; var startPos:Array = new Array(); for (var i:Number = 0; i<numberOfElements; i++) { var startObjs = eval("startobj"+[i]); [Code] .....
But when I trace all I get is 0,0,0,0. Is this something to do with in AS3 there is no connection between names and things?
In script below I want to pass the String received at function WhichPage to function Adder which does not get triggered till user interaction. I know I can store the String (page) in a global variable but wanted to know another approach to this. Can request the value from the WhichPage function or get to send it to the Adder() function without triggering it.[code]...
I have a problem with returning variable between classes. As far as I know there are some ways to do it but in this particular case I tried to use Getter.
So I have an XML file (content.xml), a class to read XML (LoadXMLExt.as), a class to display images, and the main class which first call the LoadXMLExt to get the information from and then call the displayimage class including passing the information from LoadXMLExt.
create and send a variable called "return." But that conflicts with a word used in actionscript.[code]is there anyway to work around this naming conflict?
First of all sorry im not very familiar with the flash lingo, im still new to all this actionscript stuff
ok so i wrote this on a frame in the timeline[code]...
now i need to check which one from all these has a value of zero. then when it finds it i need it to tell me which one it is (s1x or s2x or s3x) so i can do stuff with it.
I have a function inside of a class which is called by an event Listener I need access to a variable inside the function after the eventListener has been called. The variable name i need is stream and the function it lives in is called NetStreamxx. I tried to return stream but i don't know how to access the returned value here is the code
I am trying to implement paypal payment in as3. But the return variable conflicts with an as3 keyword. So how to set return variable for returning from paypal to merchant site.
I'm using flash CS4 and actionscript 2.0. I have a situation where I need to locate and check the date of an external file (either .exe or .swf) and return that date string to a variable in flash. I then need to display that date to a piece of dynamic text within the flash file. Is there a function within action script that will check and retrieve the file date of an external file.
I am trying to add a Paypal Buy-It-Now button to my Flash site.The basics are simple enough:
this.cmd = "_s-xclick";this.hosted_button_id = "1234567"; this.getURL( "https://www.paypal.com/cgi-bin/webscr", "_blank", "POST" ); ...however, one of the button parameters to post is called 'return'.
I want to create several variables (actually tween objects) in a for loop. I want the variables to get names like "variable1" when i =1, "variable2" when i = 2 etc.
I am trying to pass the text from an input text box to a sender variable called variables. The first line of code works fine, but how do I make it dynamic so I can use a loop to load the "first" names into variables.first1, variables.first2, etc.This works great...
variables.first1 = this["first"+i+"_txt"].text;
But when I try to make the left side of the statement dynamic, it does not work.
i need to create an arbitrary number of display objects using a for loop because the number of objects will depend on the number of items in an xml file.
so i want to control the objects using actionscript. in as 2 i could create a temp variable in the for loop and use attachMovie() and assign an instance name. i know in as 3 you can use the .name property, but i heard you had to use the variable handler to control the object.
so i can't do this because it generates an error:
var numOfItems:uint = 5; for(var i:uint = 0; i < numOfItems; i++) { var mc[i]:MovieClip = new MovieClip(); }
Code: save_all.onRelease = function(){ for(var n=0;n!=cArr.length;n++){ ///some other stuff
[Code].....
I want the php file to be sent the variable and loaded as many times as the length of the array cArr... lets say cArr is 16 pockets long... only the 16n from textsave array gets sent to flash via the lv5.specialVariable... I'd like the script to run 16 times, each time with the value of n getting sent as the specialVariable..
I have an actionscript Tween that travels from the top of the stage to the bottom.I want to have a variable that displays the Y coordinate. To do this i have tried an if statement and a for loop, but none seem to work.[code]
In other words, I want the variable to increase by one each iteration of the loop. I'm sure there is a simple solution to this and I am currently banging my head against my desk