-
1. Re: Variable to String Mapping
kglad Oct 13, 2009 9:41 AM (in response to chris_songer)i'm not sure if this post is in the wrong forum and you're using flashlite (because setVariable() is otherwise antiquated) or you're asking a different question but, if you want to convert a string to an object in as2 (since flash player 6) or as3, use array notation:
// in the scope of a movieclip
var tl:MovieClip=this;
tl["testSetValue"] = "foo";
-
2. Re: Variable to String Mapping
Raymond Basque Oct 13, 2009 10:07 AM (in response to chris_songer)You'll probably have to use ExternalInterface. With AVM1 swfs, the names/value pairs set using SetVariable were assigned to _level1 and could be easily retrieved. Not so with AVM2 swfs. Here's a little reading material.
http://blog.another-d-mention.ro/programming/communicate-betwen-c-and-an-embeded-flash-app lication/
-
3. Re: Variable to String Mapping
chris_songer Oct 13, 2009 11:09 AM (in response to Raymond Basque)From the second blog post:http://bojordan.com/log/?p=269
"To set a variable in the Flash code named “myFlashVariable” to the value “Hello Flash”, just call:
this.yourFlashControl.SetVariable("myFlashVariable", "Hello Flash!");"What I was originally looking for, is documentation for how the string "myFlashVariable" is constructed in the face of name spaces, containing classes etc. Sounds like this is now complex and obsolete.
ExternalInterface does what I'm looking for -- since one can obviously use it to produce a "set" function and hopefully a "get" function as well.
Of course that left me looking for the detailed documentation about how the as3 function signature is translated back and forth from XML. That's available under the tree here:
and is specifically addressed here (though notably they specify <arguments> by example only and I'm still not 100% clear on how return values work):



