ActionScript 3.0 :: Pass Content Of Variable Named After Current Object Into Text Box

Feb 28, 2011

I'm writing a drag and drop game, and when an object is dropped I need information about
that object to pop up in a text box. I've got the draggable objects set up via a class. Within the class I have variables set up with the text for each object such as

[Code]....

View 7 Replies


Similar Posts:


ActionScript 2.0 :: Create An Xml Object (or Any Object In Fact) Named After A Variable

Oct 28, 2003

How can I create an xml object (or any object in fact) named after a variable, i.e variable called section with value "names" create object [section value + "XML"] = new xml(); result: empty xml object called namesXML

View 3 Replies

ActionScript 2.0 :: Load A Variable From A Text File Named "variable_file.txt?

Oct 9, 2004

I am trying to load a variable from a text file named "variable_file.txt" The variable in the file is "var" and I am trying to assign the word "value" When I run the following code:

Code:
loadVariablesNum("variable_file.txt", 0);
trace(var);

I get the following:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 2: Unexpected '!' encountered
trace(var);

other times I have tried this I get "undefined"

View 11 Replies

ActionScript 2.0 :: Can't Pass The Variable To The Object

Dec 10, 2009

i only know AS2, and was not doing actionscript for a while. i can't pass the variable to the object, please check what's wrong with my script. i want to put a variable after the obj. so when it randomize, it pass the random number after the obj.

obj1._visible = false;
obj2._visible = false;
function reveal() {

[Code]....

View 5 Replies

ActionScript 3.0 :: Pass Variable Into Object Property?

Apr 26, 2011

ActionScript Code:
var object:Object = new Object()
var counter = 0

[Code].....

Can you really not pass a variable into an Object property?

View 3 Replies

Actionscript 3 :: Pass Object Type Variable To Another Class But Keep Structure?

Jan 7, 2012

My doubt is this:I have this variable in this class A

var obj:Object = new Object()
and its structure:
obj.name = "John";

[code].....

View 1 Replies

ActionScript 3.0 :: Pass External Text As A Variable?

Aug 13, 2010

I have a video player which plays several files which I can replace externally. I want a viewer to be able to click on a movie and be taken to a specified web page (HTTP)

I do not want to have to open and update the swf every time I change the movies.

Can I load the contents of a .txt file which contains the web address and the use that veriable to replace the address in navigateToURL command.

View 1 Replies

ActionScript 1/2 :: Dynamic Text Boxes One Named "item" And One Named "ssnumber"?

Jan 17, 2011

here is my new code that works for PART of my movie. i have two dynamic text boxes, one named "item" and one named "ssnumber" ssnumberNode works fine but itemNode does not. i bolded the parts that i think are relevant to the problems

[Code]...

View 3 Replies

ActionScript 2.0 :: Pass Input Text To LoadVars Variable?

Oct 14, 2009

[code]...

I have an input field with the var name "chosenloc" in the same scope as the timeline I'm working in. I've set the input field var in code, on the fly, and by entering a number right into the field.

View 2 Replies

ActionScript 3.0 :: Pass Data To An Object Text Field?

Jan 28, 2011

I am loading txt data with data load event handler. When the data is loaded, I want to pass certain data to different object text fields. This is what I would like to do, but does not work.

[Code]...

View 4 Replies

ActionScript 3.0 :: Read Text File And Save Content Into Variable?

Jul 28, 2009

I have a sample.txt file which contain a single word and I need to put this word into a variable on swf.[code]...

View 5 Replies

ActionScript 3.0 :: Flash - Acess Variable Named <str> From Php File?

Oct 27, 2010

i try to acess a variable named <str> resides in php file from my as3 filebt i got this error

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()

[code]...

View 3 Replies

ActionScript 3.0 :: Creating Variable Named By Concatenating Two Array Elements.

Oct 2, 2009

A snippet of my code is [code]The first element in the mainOptions Array is linked (metaphorically) to tab1.The second element in the mainOptions Array is linked (metaphorically) to tab 2 and so on.I want to create 12 variables named AudioMP3, AudioHEAAC, NewsBBC, NewsTwitter, VideoVideo and so on down to PicsPics2. i.e concatenate each entry in say tab1 through 5 to the each element from mainOptionsArray and make a new variable using that name then assigning a number to this variable.[code]

View 1 Replies

ActionScript 3.0 :: How To Retrieve Named Object

Jan 23, 2010

Inside my loop, where i get my XML objects I added a code to draw and add the mask:
 
var myMask:MovieClip = new MovieClip();
// settings for width height x y color fill etc etc.
myMask.name = "NAME-"+i; // set the NAME
myContainer.addChild(myMask);
myContainer.mask = myMask;

 the mask looks fine on the stage.now since i name it, i want to use it for other purpose like moving it now i want to actual call myMask
i get my number "num" from other function, that works fine
 
function applyMask(num:int):void {
// need to call   myMask("NAME-"+num)
}
 
i have tried myContainer.getChildByNamehave tried:         

var masking:myContainer=getChildByName("NAME-"+String(num)) as myContainer;

i have traced for options i can think of myself, but all result no property found. 

View 3 Replies

Flex :: Creating A Dynamically Named Object?

Jul 27, 2010

I'm trying to create a dynamicly named object.

something like

private var myVar:String = "dynamicName";
private var [myVar+"staticName"]:Object = new Object;

but what i wrote above dosn't work for some reason.

View 2 Replies

ActionScript 2.0 :: Work With A String Named Object?

Jan 14, 2008

...so, I have the following code

for (i=1; i<=n; i++) {
duplicateMovieClip(_root.object, "object"+i, i);

how can I choose the position of the new MovieClip?

"object"+i_x = random(100) - this should work if I had a different name of variable, but in this case it doesn't.

set("object"+i_x, random(300)); - this doesn't work neither
}

View 3 Replies

ActionScript 2.0 :: Pass A Variable As Well And Can't Seem To Escape To Pass It?

Apr 6, 2008

Trying to pass a variable as well and cant seem to escape to pass it. How can I pass using window.open as such: Trying to pass (pid) all i get back is (pid) and not actual pid.How to on a jscommand?

Code:
something.onRelease = function () {
var jscommand:String = "window.open('http://www.someform.php?proj= + (pid)','win','height=200,width=300,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); }

I can do a standard getUrl("http://www.someform.php?proj=" + (pid), "_blank"); works fine but no control over window properties.

View 1 Replies

ActionScript 3.0 :: Pass As XMLList, Or Parse And Pass As An Object?

Oct 28, 2009

I'm having to pass data (originally read via an XML file loaded by the parent class) to a child class upon instantiation, and I can't decide which is the better method.I could parse the XML in the parent and throw the data into an Object and pass that object to the child class....or just pass the part it needs as an XMLList and let the child class do the parsing.Seems like a trivial decision, yes, but I'm not sure of longer-term implications.

View 3 Replies

Flex :: 3 - Pass 'self' Or 'this' When Calling A Function Inline For Current Component?

Dec 5, 2011

I hope I have worded the question ok. I know that you can pass the 'id' of the component but I'm just wondering if there is a more generic way. I have tried using 'this' (shown in example below) but the 'this' keyword refers to the application.

[Code]...

View 1 Replies

Flex :: Call Inline Function And Pass In Current Item As The Argument?

Jun 8, 2010

Im trying to create a loop of items like this...

for each (var btn:Object in ViewButtonData)
{
// build element[cocde]..........

I would like to pass in current HBox to the 'HoverTab' function. Is there a way to do that?

View 3 Replies

Javascript :: Pass The Variable So That The Resulting Line Of Code Doesn't Have The Quotes Around The Variable Value?

Oct 3, 2011

I'm trying to pass the contents of variable playnoyes to the long line of code below to decide whether or not to autoplay the flash movie, but doing it as I have below, the resultant line of code has the variable in quotes and therefore the code doesn't execute it as expected. My question is, how can I pass the variable so that the resulting line of code doesn't have the quotes around the variable value.

var playnoyes='true';
var testtext = "<script type='text/javascript'>AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.[code]....

View 3 Replies

ActionScript 2.0 :: Current Content To Fade Out And The New Content To Fade In?

Jan 29, 2004

am a graphic artist trying to be a web designer and it's not working! I am constructing a website where I have a navigation menu nested within a movieclip. On each button click I want the current content to fade out and the new content to fade in. Content consists of new imagery and text. Now since I have these buttons nested within a MC I realize I'm unable to simply use simple gotoAndPlay because it will not be referencing the main timeline. Forgive my AS ignorance,

View 3 Replies

ActionScript 3.0 :: Declare A Variable In PHP And Pass That Variable To My Flash File?

Mar 5, 2010

I am trying to do is declare a variable in PHP and pass that variable to my flash file. Right now i am simply trying to do 1 easy variable, more will happen in the future but i need to figure this out first.I have used other forums and they say try this and that, but nothing i do seems to work. here is my code.

PHP Code:[code].....

View 8 Replies

ActionScript 3.0 :: Embedding Font - Put A Dynamic Text Field There - Named TextBox

May 20, 2010

1) Create a New Flash File (AS 3.0)
2) Put a dynamic text field there, named textBox
3) The font is Trebuchet MS - BOLD. (example... can be any bold font)
4) Using "Character Embedding", I've embedded numerals, for example.
5) In first frame, I put the code: textBox.text = "1";
6) If I compile at this point, the "1" will appear.
7) BUT.... if I put a static text box with anything typed, using Trebuchet MS - REGULAR, and compile the FLA again, the number 1 WON'T appear!

View 6 Replies

ActionScript 3.0 :: Object.VARIABLE - Call A Field Of A Object Using A Variable?

Sep 1, 2009

Is it possibile to call a field of a object using a variable? Something like:

[Code]....

View 5 Replies

ActionScript 2.0 :: Initialize The Object With A String Variable Which Holds The Initialization Properties (without Parsing The Text)

Dec 5, 2005

I initialize the "point" object like:

point = {x:'209', y:'270'};
trace(point.x);

this is working fine, But I have to initialize the "point" object with a string variable which holds the initialization properties like:

[Code]...

I know this is not working. Is there any method to initialize the object with a string variable which holds the initialization properties (without parsing the text) ?

View 7 Replies

Pass A Variable With Brackets In The Variable Name?

Nov 20, 2010

I am trying to pass a variable with brackets in the variable name. Example

productoption[]="value";

Whenever I publish the file flash gives me an unexpected "]" error code. Is it possible to have a variable name with brackets? I tried to use the escape codes %5B%5D to pass the brackets but that didn't work also.

View 1 Replies

ActionScript 2.0 :: Pass Php Variable To Variable?

Nov 28, 2009

i write my own code for php and actionscript...and i had a problem with it.. How to pass php variable to action script variable?

[Code]....

View 3 Replies

Flex :: Global Variable - Updating To Current ID

Aug 10, 2011

I am trying to work with a global variable in Flex and it does not appear to be working correctly. In my default mxml file I declare the following
public var appID:int;

This variable keeps track of the session ID across my application for SQL purposes. On another mxml page I call the following code which should update the global variable to the current ID.

// Get the ID
sqlStatement.text =
"SELECT Max(id)FROM applications";
sqlStatement.execute();
var result:SQLResult;
result = sqlStatement.getResult();
FlexGlobals.topLevelApplication.appID = result.data[0];

Lastly I run a SQL Update query using the ID as a parameter. My problem is that the FlexGlobals.topLevelApplication.appID is always 0, for some reason the global variable never gets updated, I have checked to ensure that result.data[0] is correct but the value never gets passed to the global variable.

View 2 Replies

ActionScript 2.0 :: Current Time As Static Variable?

Oct 7, 2008

I've been trying to create a script that pulls the current time and turns it into a variable, the problem is the variable keeps updating as the time changes, where as I need it to remain static as the time that is was when the variable was first created...it's just a simple:

Code:

var theTime = today.getTime();

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved