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


Similar Posts:


ActionScript 2.0 :: String-var Named NavC That Is Either Set To "work"?

Oct 23, 2005

I have a String-var named navC that is either set to "work", "about" or "contact". I have three different String vars: workText, aboutText and contactText containing some text...

Depending on the value of navC I want the text field textbox_txt to show workText, aboutText or contactText. So I want to set textbox_txt to navC+Text...

I can't figure out the syntax for this and keep getting outputs like 'workText' etc. when in fact I want the output to be whatever is in the variable workText etc.

View 6 Replies

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 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 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

ActionScript 2.0 :: Parse Out Url String Using The String Object In Flash?

Jan 13, 2005

I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.

In flash I want to parse the string that I get from the database and look for URL strings that start with http "http://www.someurl.com" and parse out that substring.

For example the string could be "Please vist my site at http://www.site.com". I would want to parse out the http://www.site.com

If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield.

Does flash have an object that deals with Regular Expressions? I've looked at the String object in flash but not sure how to achieve this task

View 2 Replies

ActionScript 2.0 :: Way To Parse Out A Url String Using String Object In Flash

Jan 13, 2005

I'm creating a CMS(Content Management System) tool so that users can change text and the changes be reflected in a text window in flash . The text that the user enters in the CMS tool will be stored in the database.In flash I want to parse the string that I get from the database and look for URL strings that start with http "URL..." and parse out that substring. For example the string could be "Please vist my site at URL...". I would want to parse out the URL...If I find this url string I want to pre-pend the a href tag <a> and append the closing </a> tag to the string so that this link will be clickable from the textfield. Does flash have an object that deals with Regular Expressions?

View 2 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 :: Web Service [object Object] - Get The Array Values Back Out As A String?

Apr 4, 2011

I'm working with a web service and am returning an array to a field (that I set the data type as an Array). The result thus far is "[object Object]". How can I get the array values back out as a string?

View 0 Replies

ActionScript 2.0 :: String To Object - Easily Convert It To Object Properties?

May 17, 2005

Allright, i receive a string and want to convert it to object. here a test that i have made:

[code]....

this work pretty fine... but i am receiving the object property as follow: "{a:'test',b:'testAgain'}" How can i easily convert it to object properties?

View 4 Replies

Flex :: Difference Between An Object And String Object?

Apr 27, 2010

I think i am lost with basics itself. What is the difference between these two. String object is an instance of String Class.

[Code]...

View 3 Replies

ActionScript 1/2 :: String Replace Will Not Work - Traces To Q23.swf And Q23

Dec 20, 2010

[Code]...

it traces to Q23.swf and Q23 I want Q_23.swf where the original value is "Q23" Does anyone see what I am doing wrong?

View 2 Replies

ActionScript 3.0 :: Using String In TextField To Work As Button?

Aug 7, 2009

Is there any way to have a text field and a particular string in that text field work like a button. For example if I have the following text placed in a textfield via mytextfield.text =
Code:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sed sem neque, a dapibus velit. READ MORE, id feugiat est. Quisque bibendum cursus varius.
And I want to attach a listener for mouse over to the read more text but not any other part of the text is there any way to do that using htmltext.

View 9 Replies

Actionscript 2.0 :: Asfunction Doenst Work With Dynamic String

Sep 22, 2009

I want the to use the 'edit_pizza' or the 'add_pizza' function whether i am editing or add a new order. So i am checking if "aktOrder" is set (or filled because it is an array) and setting 'clickFunction' the name of the function.Afterwards i put that in the string which will be added to "windowText.htmlText" at the end. By tracing 'clickFunction' i see that it is 'add_pizza' which is right. But in the string it doesn't work.

View 5 Replies

ActionScript 2.0 :: Casting String To Number Doesn't Work

Sep 15, 2010

I have Input text field on Scene with instance name number_txt.[code]

View 9 Replies

ActionScript 2.0 :: Passing Var To Flash Thru Query String Doesn't Work

Sep 25, 2009

I want to pass a variable to my Flash .swf file through a query string.In my Flash movie I have an animation of 2 goats fighting, I want the query string to tell the movie to skip to the end of the movie if variable goats==attacked. I used the following ActionScript:[code]The problem is that no matter whether I attach the query string goats=attacked at the end of the html address or not the movie never skips to the end.

View 4 Replies

ActionScript 3.0 :: String Compare Does Not Work Inside Array For Match

Feb 6, 2010

How to compare a string with strings inside an array for a match? I have a file in which each sentence (or word) (generally string) is present in a new line. Opened the file and read the contents to a string.

Code:
private function readHandler(event:Event):void{
_str = _readStream.readUTFBytes(_readStream.bytesAvailable);
_strArray = _str.split(" "); //contains each string that appears in a new line
_length = _strArray.length;
[Code] .....

But this doesn't work. Seems like if(_input == _strArray[i]) never gets executed even if they are equal. What might be the problem. Is there some better way to so it?

View 6 Replies

.net :: Serializing An Object As A String?

Mar 9, 2010

We have an Adobe Flex client talking to a .NET server using WebORB. Simplifying things, on the .NET side of things we have a struct that wraps a ulong like this:

public struct MyStruct
{
private ulong _val;

[Code]....

I've tried playing with custom WebORB serializers, but the documentation is a bit scarce. Is this possible? If so how?

I think I can work out how to serialize it, but not the other way. Do I need to write a Custom Serializer on the the Flex end as well?

View 3 Replies

ActionScript 3.0 :: Referencing An Object With A String

Apr 19, 2010

I need to know how to call or reference (not sure of the terminology) an object by way of a string. What I'm trying to do is create a loop that will add event listeners to objects named "portfolio1" through "portfolio15", and use a function.[code]If I could just reference these fricken objects through a string and an integer, I could set up a small loop like this to make the button "portfolio1" bring up a big jpeg of "bigportfolio_1", and "portfolio2" bring up a big jpeg of "bigportfolio_2", ext. While yes, I could just go through them all and set up event listeners to each one individually, but its REALLY inefficient. Also, I am still working on more advanced actions (like scrolling through the portfolio pics chronologically) that absolutely requires a different reference method.

View 5 Replies

Professional :: Change Object Name In A String

Aug 31, 2010

I want to create a XML file that I can change for different languages. It contains the names of the fields that have text and the text that they should be changed to: eg. <lang name="titleLabel" value="This is the app title" />. I can read in the XML lines into an array but I can't figure out how to use the name as an object name:

[Code]...

View 1 Replies

ActionScript 3.0 :: Get Object's Property By It's String Name?

Nov 26, 2010

There is a function that receiving value of String = 'propertyName', wich is property name.and i have an Object item with property of name equals to 'propertyName'.How do i get item's value of that property?ObjectUtil.getClassInfo(item).propertiesreturns an Array of item's properties, but is it an easier way to get it instead of searching trough Array?

View 3 Replies

Flex :: ActionScript 3 Object To Name Value String?

Jan 18, 2010

In a Flex application I am trying to turn an Object into a QueryString such as name1=value1&name2=value2.But I am having trouble getting the names of the Objects children. How do I enumerate the names instead of the values?

View 2 Replies

Actionscript :: Xml - Turn An XML String Into An Object

Feb 8, 2011

I am pretty new to AS, and I am assuming there is a way to do this and I am just not figuring it out. Basically, I am trying to use a service that returns xml and return an Object regardless of the structure of the xml. In .Net I use the XmlSerializer.Deserialize class... is there equivalent in AS?

I was able to find SimpleXMLDecoder but I can't seem to get it to work - it also looks like it might only work with nodes? Either way, the examples out there are sparse and hard to follow, I just want to know how to take xml like this:

[Code]....

And simply turn it into an Object - is this possible without writing my own parser?

View 2 Replies

ActionScript 3 :: Object's Property Name To String?

Mar 18, 2011

I want to eliminate usage of magic strings in these:

BindingUtils.bindProperty(obj1, "propertyName", obj2, ["childObj", "anotherProperty"]);

or

var ddl:DropDownList = new DropDownList();
ddl.labelField = "propertyName";

it would be sweet to just type something like:

[Code]...

View 3 Replies

ActionScript 2.0 :: Convert Object Name Into String

Jan 14, 2009

I am wondering if it is possible to convert an Object name into a string anf then remove an element from the string so I am left with just the number I can use and pass as a variable. This is a stripped down version of the code

[Code]....

View 2 Replies

ActionScript 3.0 :: Object To String To Send To Php?

Aug 21, 2009

I am supper stuck I have a Object and need to send that to a php script as an associative array. When i send the object itself it.

View 9 Replies

ActionScript 3.0 :: Calling Object With String?

Feb 15, 2011

my library is filled with a movie clip for each letter in the alphabet (26 movie clips). I also have a blank symbol on the stage. When the movie starts, it generates a random 8 letter string from an array of letters. The next part is supposed to take the first letter of the newly generated string, pull the corresponding movie clip from the library, and display it in the blank symbol on the stage. After that, it moves to the 2nd letter, and so on. Ultimately I'm trying to have 8 random letters from the alphabet array set the corresponding movie clips on the stage.

View 2 Replies

ActionScript 2.0 :: Changing An Object Name To A String

Apr 26, 2004

Is there any way to do this? Say I have a global variable called yarr: _global.yarr = textbox; and I want to change that in to a string, I want to change it to "textbox" instead of textbox. Is there any way to do that?

View 8 Replies

ActionScript 2.0 :: Create An Object With String?

Mar 9, 2005

Is there anyway to create an object with a string?

For example : var myClassString:String = "myClass"; // myClass is my real class

then create an object with something like : var myObject object = new myClassString(); // I need to create the object from the string ...

View 1 Replies







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