ActionScript 2.0 :: Pass A Series Of Properties As A String?
Feb 4, 2008
I want to pass a series of properties as a string to a webservice:Version1: This works
Code:
var mxna_ws:WebService = new WebService(WS_URL);
var var1:String = "1";
[code].....
View 1 Replies
Similar Posts:
Jan 2, 2008
I've got an XML file that I get the URL for my server from and also get the names of videos to populate a list.I can get the URL into a string in my program (it traces fine). when i try to pass that string in my nc.connect(string) it doesn't work. Everything loads fine, but when you click a video, it can't connect to it. If I manually enter the URL into the connect field like this:nc.connect("rtmp://url") it works fine.Why can it take the URL manually entered and not from a string?
View 9 Replies
May 8, 2008
i have and xml that passes these image details to be loaded into flash. image path, x,y,heigt,width, rotation i use moviecliploader and attachemovies with a for loop to load the images. but find difficult set images there respected property after onLoadComplete even if the movieclip loader as i can pass the approriate values in to movies.how to pass the properties into onLoadComplete even of the image
View 3 Replies
Mar 19, 2010
In actionscript an object's property can be accesses in this way: object["propertyname"] Is something like this possible in c#, without using reflection?
View 2 Replies
Jan 1, 2011
I have the following problem in AS3. I have a string like this one: "prop1:val1,prop2:val2,..."; I want to split and parse the string to obtain a dynamic object like this one: {prop1:"val1", prop2:"val2"}.
The simple way to solve it is to cycle through the string values and to do[code]...
Since I know the property names I expect, this works for me, but doesn't seem to be an elegant solution. I'm wondering if there is another way in as3 (similar to the reflection api in java).
View 2 Replies
May 1, 2011
I have an engine I created a while back that loads objects into a container based on XML data. A really quick example of the XML would be like this:
<level>
<object cname="enemies.Robot">
<pos x="200" y="400" layer="mobiles" />
</object><object cname="Player">
<pos x="12" y="89" layer="mobiles" />
</object></level>
I have a class Environment that has a method loadLevel(data:XML) which I parse the XML through, then the function runs through the XML finding all object nodes and uses getDefinitionByName to determine which Object I want to create based on object.@cname. From here, I have to manually define each property based on the XML like so:
obj.x = xml.pos.@x;
obj.y = xml.pos.@y;
etc.
I was wondering if there's an inbuilt method for setting a property based on a String. By this I mean something like so:
var mc:MovieClip = new MovieClip();
mc.someInbuiltFunctionThatSetsAProperty("alpha", 0.5);
This way I could change my XML to be more like so:
<object cname="Player">
<props>
<x>200</x>
<y>221</y>
<alpha>7834</alpha>
<health>Something</health>
<power>3</power>
</props></object>
And iterate through all the children of props to set all of my properties on the fly. I know if I create an Object and set properties within it like so:
var obj:Object = {
var1: "hello",
var2: "there",
name: "marty"
};
That you can then iterate through names/values using the for(String in Object) loop like this:
var i:String;
for(i in obj){
trace(i + ": " + obj[i]);
}
/**
* Output:
* var1: hello
* var2: there
* name: marty
*/
Surely there's a way, as here's an example of identifying a property using a String:
var ar:Array = [new MovieClip(), new MovieClip()];
ar.sortOn("alpha", Array.ASCENDING);
So just to make my question more to-the-point: I want to be able to get and set properties that I can identify using a String.
View 2 Replies
Jan 28, 2008
I have say 50 movie clips on the stage. each has a name like "button1", "button2" etc and I want to move each one using a for loop instead of hard coding "button1._x = 50"
When I try this it doesn't work.
Code:
var buttonName = "button1";
buttonName._x = 50;
View 6 Replies
Jun 22, 2010
How can I pass a string from PHP to Flash?
I need to pass this to flash[code]...
View 2 Replies
Aug 3, 2011
I am using Flash CS5, never touched Flex. Also the SWF that is doing the loading will be a client SWF, so hoping for a solution that could work with a simple couple of lines.
Basically inside the SWF I am working on contains just a simple string:
var theString = "theString";
trace("theString = "+theString);
Now I've been working on a test loader SWF that will load my String SWF and get the variable in the simplest way. Any thoughts? Below is my current broken code:
function loaderComplete(event:Event)
{
trace("... in loaderComplete");
getString = loader.content.toString();
[Code].....
I've searched on Stack and found similar questions, but none are exactly what I need:
tracking video files - embedding flv to swf
^ Basically what I'm trying to do as well, no answers yet
to pass variable from one swf to another swf in as3
^ sounded just like my problem, but answer was a Flex application example
pass var values from one swf to another swf who is loaded inside the firts one in AS3
^ This was close, but am not sure how to implement the chosen answer, also seems a bit more intricate then I need
View 2 Replies
Dec 21, 2009
Is there any way that you can pass a string to a function and use its value as the variable name you wish to change. For example.
Code:
var text:String = "Goodbye World";
function myfunction ( varToChange)
{
varToChange = "Hello World";
}
myfunction("text")
View 2 Replies
Jan 27, 2010
I created 4 buttons with 4 animations each, one for each state (using tweens), so I have that imense list of 16 "addEventListeners" (don't know if there's another way to do it). But everything is working as I would like.
The problem is that I'm trying to create only 4 functions to take care of all the 4 buttons and those 16 eventListeners.
This is part of my AS3 file (still with the "traces", 5 secs of animation to check the animations and all).
[Code]....
View 10 Replies
Feb 13, 2010
So, I want to pass a string variable to a SWF so that I can specify a XML file to load without republishing the SWF. When I assign the string variable to a textfield it is correct. But when I use that variable in the loader it does not display the XML from that file. You can see below that I commented out the string "lesson_11/images/0301_objectives.xml". If I put this string in the loader it works, if I use the string variable in its place it does not work. Can anyone see what I am doing wrong
Code:
var xmlFileToLoad:String;
var myQueryString:Object;
[code].....
View 1 Replies
Oct 7, 2010
How to display the correct digits. For instance, if the answer is 97%, I want the display to show 97, not 11. Please feel free to view the SWF or look at the FLA file to see[code]...
View 5 Replies
Feb 27, 2011
How can I pass a string to an array?
What is the difference from doing:
Code:
private var myArray:Array = [{option: "MAR11 100 C", contracts: "-10"},{option: "APR11 100 C", contracts: "10"},{option: "MAR11 90 P", contracts: "-10"},{option: "APR11 90 P", contracts: "10"}];
[Code]....
How can I assign that "text string" to another variable and then pass it into an array?
View 2 Replies
Mar 12, 2006
I'm creating a webpage where all the content is within the same swf. In order to get things to work I have all my different content in different MC's. Each of those separate MC's have two frames inside. One where it's empty and the other where the content is displayed. To make this work I have a variable name 'page'. My menu is supposed to pass a string to this variable and at the same time trigger a transition to be played ('doors' sliding over and hiding the stage).
Then the transition sets all my content MC's to the hide position. Then it checks what the page variable is and sets the corresponding content MC to show before the 'doors' open again. At least that's how it's supposed to work in theory. But I haven't figured out how to do all this. First off I don't know how to get my menu to pass that string to the 'page' variable. Here's my menu with the problem area marked:
[Code]...
View 6 Replies
Mar 18, 2009
Is there any way that you can pass a string to a function and use its value as the variable name you wish to change. For example.
[Code]...
View 1 Replies
Sep 11, 2009
How do you pass Query String in AS3 in FLASh CS4?
View 1 Replies
Jan 10, 2011
I'm a beginner that is stuck at the moment. I've made several comboboxes, and what I am trying to accomplish is add those values to an url and pass it.Example: In the first combobox I select year: 2009, second one I select genre: horror, third one I select language: us, which then should string those together and give me this url for example, "file.php?year=2009&genre=horror&language=us"I am working with an array, filling it with values and then stringing it together, but several problems arise, first one, I don't know how to skip the "&" for the first value. Also I do not know how to ignore undefined values in the array.Here is just one combobox I use and the handler:
Actionscript Code:
var seljaartal:Array = new Array({label:"Year", data:""}, {label:"1939", data:"jaar=1939"}, {label:"1940", data:"jaar=1940"},
[code].....
View 7 Replies
Mar 5, 2010
I've been searching ferociously and can't seem to find a solution that works for me. I am trying to pass variables via query string on a PHP page to Flash, and then have the swf add movie clips to the stage depending on the information it receives. Here is what the PHP outputs:
[Code]...
View 2 Replies
May 13, 2010
so I have my php API (html Get api for Flash builder and C# apps). So if you want to submit data to it you use string like
[URL]
If there are english letters in it its ok. But what if I need to pass UTF-8 string like this Русское Имя to my api what shall I do?
View 1 Replies
Aug 7, 2010
I want a way to pass a string statement from one base class to an other. The two classes are CLICK and READ.What's an easy way to do this? I haven't worked in classes that often to know some of the simple tricks.
[Code]...
View 2 Replies
Sep 13, 2011
I cant pass the query string while using the debugger or else i cant debug when there is a query string. how to use the bothAm using a web application in flex using php for ex : [URL]
View 2 Replies
Mar 17, 2010
I'm fed up of having to import the tweener class every time I create a tween, so I want to create a global function that I can call which will import them for me, as well as executing a tween.[code]...
View 7 Replies
Jun 18, 2006
Can buttons take variables? Right now I'm trying to pass a string into a buttons text field with:
this.button_btn.one_txt.text = "hey";
It doesn't work, and the path is right? Is there something special I need to do?
View 3 Replies
Nov 7, 2009
Is there a way for flash variables or text to become available to an external program? I have a flash projector and a windows program that I am writing and I need a way for the the windows program to recognize what the flash is doing (But the flash does not need to know what the windows program is doing.)
View 2 Replies
Apr 29, 2010
Parent loads Child, and wants to pass text string to Child. How can Parent pass a string
to Child swf?
PARENT.SWF
//LOAD CHILD 'has a symbol on stage called LDR that CHILD loads into'
var loadCHILD:Loader = new Loader();
LDR.addChild(loadCHILD);
var bgURLTxt:URLRequest = new URLRequest("CHILD.swf");
[Code] .....
CHILD.SWF
'has DynamicTextfield called txtBuddy'
View 1 Replies
Mar 1, 2011
I have a very odd problem with Flash 10 and ExternalInterface. I am currently using a homemade bridge to use RTMFP with Javascript and whenever I try to pass data that contains JSON, I get a wierd Javascript error that comes from Flash[code]...
View 2 Replies
Jun 14, 2010
I want to pass a string variable to a SWF so that I can specify a XML file to load without republishing the SWF. When I assign the string variable to a textfield it is correct.But when I use that variable in the loader it does not display the XML from that file.You can see below that I commented out the string "lesson_11/images/0301_objectives.xml".If I put this string in the loader it works, if I use the string variable in its place it does not work.
Code:
var xmlFileToLoad:String;
var myQueryString:Object;
[code].....
View 1 Replies
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
Jan 29, 2010
I am asking this question as a complete Flash novice, so please do point out if I'm doing anything wrong here (I suspect I am). I have a Flash MPU size animation with a link in it which has been created by using a full sized transparent layer as a button (is that the correct way) with the following ActionScript:
[Code]...
View 1 Replies