ActionScript 3.0 :: Pass Variables From Combobox To String Together An Url?
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"},
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:
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?
I am trying pass a variable to php using a combobox. I can do it using a text box because it has a place I can give the text box a variable name. The combobox does not have a place to give it a variable name.I am trying to pass the data column of the combobox as a variable to php?
I need to be able to pass some variables FROM flash and append it to the end of my address. I assumed that if I used LoadVars, I can append the vars to the end of the string like this:
ActionScript Code: send_btn.onRelease = function () { var my_lv:LoadVars = new LoadVars();
Okay I have a comboBox named 'resortCombo'. I wish to pass the label of that comboBox to another frame so that an 'resortOutput' textbox displays it.I have the following code for the Global actions:
Code: var resortLabel:String; function myHandler(evt:Event):void {
I have a list of strings that I add to an array, then attempt to set those values in a for-loop using data that I read in. The array gets updated, but the values the array contains do not. I also have an array of buttons that I update this same way that works great, but strings don't seem to work the same way. I have tried moving the string array to give it full scope, and still nothing...
public class test extends Sprite { // Declare a list of strings protected var title0:String = undefined;
I'm trying to figure out which is more efficient in terms of memory and speed. What I'm doing is having a series of messages loaded to the screen. Is it just faster to write them in string variable or in an XML document which is more versatile in terms of editing and adding on to the document.
When this code executes, flex just sets the selectedIndex to 0 and displays the first item in the dataProvider instead of leaving the text and prompt as the empty string "". How do I get around this? I need the text property to be "" unless the user selects another item in the combobox.
I am a dynamic site newbie, but have been making simple animations with Flash for some years. I have got a friend to give me a leg up to create a flash page full of input text boxes that write to a text file via PHP and are then dispayed in dynamic text boxes. [URL]. I want to replace some of the imput text boxes with combo boxes. eg if the combo box has the options of say "rigid" or "trailer" it would write which ever was selected in the text file so this would be displayed in the dynamic text box for the end user to see. It seems very simple but I have looked all over the options for combo boxes and can see no mention of variables.
I just want to acquire the existing label from the currently selected item in a ComboBox. I populated it with a DataProvider with a list of strings and it will not allow me to get the currently selected label, especially if I input a new one, not included in the DataProvider
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
this function bellow returns the String for display in an item renderer.
[Code]...
But i am blocked about the public function set selectedLabel(label:String):void is there anyone who know a function labelToItem or another solution to set my combobox selectedLabel
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).
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;
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]...
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:
I have a swf with an input text box and a button. When the button is clicked, i need it to open another swf in a new window and pass the variables to a text box in the new window.
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?
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.
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]
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]...