Flex :: Dynamically Add Variables To A URL Using It?
Jul 22, 2009
In my Flex application I am able to read the variables using something like /flexapp.html?name=josh with no problems. However, this is because I go into the URL and type in the variables by hand. Is there anyway in the code to dynamically append the variable part "?name=josh" ? For example, like retrieving the url and then adding that and then pointing to it?
i'm loading several sound files, and want to error check each load. however, instead programming each one with their own complete/error functions, i would like them to all use the same complete/error handler functions.
a successfully loaded sound should create a new sound channel variable, while an unsuccessfully loaded sound will produce a simple trace with the name of the sound that failed to load. however, in order to do this, i need to dynamically create variables, which i haven't yet figured out how to do.
here's my code for my complete and error functions:
function soundLoadedOK(e:Event):void { //EX: Sound named "explosion" will create Sound Channel named "explosionChannel" var String(e.currentTarget.name + "Channel"):SoundChannel = new SoundChannel();
I'm working on a project that requires me to load variables into my movie dynamically.I've gotten to the point where I get the variables loaded into flash. But then I cannot use them dynamically once inside flash. I understand code pretty well But I am relatively new to actionscript. The variables have to be used dynamically because I'll never know how many variables there will be. Could be 1 could be zero, could even be 1000.So say my loaded variable var.txt had this line in it.
I have a contact form in my flash file with name/email/message fields which a user can fill out and then click send, which passes these to a php script which then emails the information that they entered. This works fine when the text inputs are manually placed on the stage and all the information is passed to the php script and emailed to me. I am just updating it so the textinputs are created via AS2 so that I can style them more easily etc. This is fine however when created via script they no longer get passed to my php file. I am creating the textinput using the following code (which works fine):
var my_fmt:TextFormat = new TextFormat(); my_fmt.bold = false; my_fmt.font = "Arial";
[Code]....
This works fine however does not pick up the value of the dynamically created text input (however does pick up all the text inputs that are manually added to the stage).
I've automated a lot of my script, but cannot automate the very beginning where one sets the variables. I have the following script that I'd like to put in a "for" loop :
private var aliPlane1:Plane3D; private var aliPlane2:Plane3D; private var aliPlane3:Plane3D;
My problem is the following:I've been working with Flash CS4, and have written a script which creates a dynamic menu based on an array variable. The array variable needs to be located in a separate .as file so that I can use a bash script to create the array on the fly, based on files found in a specific folder. It's taken me weeks of writing both the bash and actionscript to make everything work smoothly. Everything works except for one small thing: when I update the file containing the array, the menu in the .swf fails to update with it. In order to update the menu, I'm forced to re-publish from within Flash itself.
Previously I had used the "include" function to place the array within my script, but I then tried bringing it in with a package as a global variable. Neither method worked. It seems that the file is included during the publishing (that's probably common knowledge). So I'm wondering if there's a way to include the array, or build the array, in such a way that will allow the .swf to update with a simple refresh of the web page.
I have a number of 'TweenField' instances created in a for loop. The problem is that each time the loop increments, the 'myTweenField' variable has the same name, so I don't know how they can be referenced individually from elsewhere in the script. How can I rewrite it so that each instance has a unique name, and how would I then reference it from outside the loop?
In the following code I would like to be able to change which object the code affects depending on which parameter name is passed to it:
Code: EventCentral.getInstance().addEventListener(ProjectEvent.SOME_EVENT, handleSomeEvent); function handleSomeEvent($event:ProjectEvent):void
[Code].....
I could write it all out with ifs and else ifs for each parameter but this code is already part of quite a large structure and it would be more elegant to be able to do it with re-usable code.
I'm trying to do it is particularly idiomatic to actionscript anyway
I am calling some data from php, which simply retrieves some data from MySQL. The tables retrieved are called dynamically and so I have a list of those tables sent to actionscript below and called by event.target.data.its and event.target.data.ces. These will have a list of the tables called. I then send the name/value pairs to actionscript from php by using those table names (all inside of php here) dynamically.
I have a contact form in my flash file with name/email/message fields which a user can fill out and then click send, which passes these to a php script which then emails the information that they entered. This works fine when the text inputs are manually placed on the stage and all the information is passed to the php script and emailed to me. I am just updating it so the textinputs are created via AS2 so that I can style them more easily etc. This is fine however when created via script they no longer get passed to my php file. I am creating the textinput using the following code (which works fine):
[Code]...
This works fine however does not pick up the value of the dynamically created text input (however does pick up all the text inputs that are manually added to the stage). I am rather confused as to why it's not picking this up and am not sure how I set it to do so, i would be immensely grateful if someone could point me in the right direction?
i am loading several images from an XML path into a flash movie and i want to dynamically create image loader variables for them. Here is my code so far:
Code: var xmlData:XMLList; var myXML:XML; var xmlLoader:URLLoader = new URLLoader();
[Code]....
method and this doesn't work for me either, i'm guessing thats because it is in the AS2 forum.
how to trace the elements in my code since my variables are populated dynamically. I have tried to use trace(cartOrder[0]); but when I do I just get the output [object movieclip]. I want it to give me the name of the handbag. My code is
var cartOrder:Array = []; Code: var cartOrder:Array = [];
I'm having a problem while assigning variables into dynamically-created MovieClips. Here's a pseudo-code of what I'm trying to achieve.
[Code]....
I need the movie clips to contain their index values as a variable within them. I've tried several approaches, including declaring the variable names within the MC itself, but that doesn't work either.
I'm still a noob with flash. But I'm attempting to make my website using itSo far I haveseveral swf files that are all loaded into a "index" swf file.So all the code needs to work with that chain of MC's:_root.LoadedContent_mc.LoadedContent2_mc.Page1_mcThats the path to where I am working..Page1:I'm attempting to create a downloads list here. I have a phpfile already worked out that scans the directories "downloads" and "imgs", and generates a list of file names. It then formats each file name into a path to that file. And turns each path into a variable that can be loaded into flash.So basically after php does its thing we are left with this:
I've got a component written for my app by a third party developer and am trying to integrate it, but I've found a bug that seems like it's either a compiler bug, or there's something with how Flex and static variables work that I wasn't aware of.Basically, I have this:
public class ModeChangeController { public static const DISPLAY_MODE:String = "DisplayMode"; }[code]...
If I use //V2 (i.e. comment out V1), a bug occurs at the startup of the application (some TextFields are uneditable and contains no text), but with //V1 and not V2, it works fine. If I comment out both, that also works fine (I don't get the TextField bug).It took me a while to figure out that it was that static const String that was causing the issue, but I'm still not sure why or if there's something I can do about it except for just moving the DISPLAY_MODE to Events (which is what I've done at the moment, but it's not a particularly nice solution).There are no errors in the log. The order of the includes in my BorderContainer code doesn't matter. I've googled for "as3/flex static initialization order" but haven't found anything.
Clarification: showInitialView() never gets called. It doesn't get there before the other bug shows up. Just having the V2 line there causes the problem.
Update: I've fixed my problem with the TextInput strings not showing: Turns out that adding the component caused the Tahoma font to not show up. However, setting the font-weight to bold fixed that problem, or switching to Arial. With that said, the original question still stands, because when I ran it without V2, it found Tahoma with normal font-weight.
I'm trying to setup a DataGrid that contains a column of combo boxes. The values of the combo boxes are defined by data specific to that row. I cannot get this to work though, I'm asking for a solution to this, either fixing what I have below or a recommendation on a different way.One of the columns of my DataGrid has an object derived from a ComboBox for an ItemEditor. The itemEditor is set like this:
I want to give the users the ability to set the background color or choose image to make it background (Tile, Center and Strentch). I tried couple of things with no luck such as trying to chaing a Skin object and assign it.and tried something like:
I have a four ToggleButton buttons that I want to behave as a group, so when one is clicked the others toggle off. I know you can do this with mx:ToggleButtonBar but I want to to use a spark skin-able component (ToggleButton). Is there a way to toggle a ToggleButton on and off programmatically or is there another way I can achieve my goal?
What is the way to dynamically create variables in an Array?
[Code]....
If you notice the code which I want to do, you will see that I want the variables of the arr Array will get from the vName Array element. And can dynamically added into the arr Array depending on the limit var. The button which controls to add the object into the arr Array can add one by one into each object or can be in one shot. how to add the variable name of an Array from a String? Or dynamically from an Array?
I am working in flex and I am just setting a variable to false. It doesnt do anything in the program but everything breaks when I put this line of code in: somevar = false;
I have two variables. One variable will contain the game type, either Squash or Table Tennis. The other will contain one of the following strings "TIME1", "TIME2" or "TIME3". The variables are called game and time. I have tried many variations on the code below to get the needed attribute but with no joy.
var result:String = node.sport.(@GAME == game).(attribute(time));
Multiple axis creation via MXML works fine: http:[url]...
But when I'm trying dynamically create horizontal and vertical axis then I'm getting extra axes. I believe this is Adobe bug. How I can fix this behavior?