ActionScript 3.0 :: Identify Variables Via URLRequest?
May 18, 2009
I'm retrieving variables from a DB via PHP via the URLRequest, and the formatting is set to variables (URLLoaderDataFormat.VARIABLES) and matches the structure "myVarName=myValue&myOtherVarName=myOtherValue&... ".
My question is; is there a way, within Flash, to identify the variables and their values, without having to know their names?, are there methods within the loader class that allow this?, such as the variables count etc?
(I can access the variable "copyrightTxt." via the syntax: loader.data.copyrightTxt because I know its name, but I'd like something like
loader.data.variableSent[45].name = "copyrightTxt"
and
loader.data.variableSent[45].value = "@ 2009"
and
loader.data.variableCount = 98
View 3 Replies
Similar Posts:
Aug 15, 2009
The question is about producing a learning package for users to improve their mathematical skills.One part of it is for times tables. So the user will enter their name and then a question will appear e.g. "What is 6 X 9?" The user then inputs their answer and the system will compare and process the input, storing the incorrect and correct responses and then giving a final score at the end.The question is to; identify the names of the likely variables and processes required for the system generation of a question and the subsequent processing of the user's response.(10 marks)Then it asks to write some pseudo-code to describe 10 consecutive question/response activities and their final results showing their name too. (15 marks)
View 4 Replies
Feb 18, 2010
I am building a simple swf that will load in variables from an asp page using a URLloader and URLRequest. The asp page loads in the current values from a SQL database but these values will change every second. My swf loops every 6 frames and loads the data. How much load this puts on the server? And when the server is busy might this cause a problem with the variables I am reading in?
Does AS3 run all actions on frame 1 before going to frame 2 etc? I don't know if this is the best way but my last variable in the ASP page is called Loaded and I test for it before moving on. My major concern is the load I am putting on the website but is this small? In firefox the status box constantly flickers transferring data from ... and waiting .. but in other browsers you can't see the activity.
View 2 Replies
Jul 30, 2010
I am trying to set up a series of URL links inside a cycling button. However, when I try to use the variable, the link sends me to the variable name instead of the URL. Below is a snippet of the code:
[Code]..
View 3 Replies
May 9, 2009
I'm trying to send variables to a payment gateway (dibs) and need to post variables to the likes of[code]...
In creating a dynamic variable I'm doing this, which works. But it's not posting the values to the php-page. (The "normal" variables are being posted just fine, so the error isn't there) [code]...
View 1 Replies
Aug 12, 2009
In my movie i have a link button with following, simple, function creating a link:
[Code]...
lately i've associated a class file (.as) to my movie and immediately after, when publishing the movie i got the following error message: 1046: Type was not found or was not a compile-time constant: URLRequest. as well as a couple of other related error messages: 1180: Call to a possibly undefined method URLRequest. 1180: Call to a possibly undefined method navigateToURL. when i remove the link to the class file, the problem goes away. also, i have checked the class file for mentioning of "URLRequest" and nothing is there.
View 9 Replies
Dec 15, 2009
Therefore, my concepts is I have webcam. My webcam is able to catch a image. Whereby, the flash will calculate the overall of the color. And it will resize and place it to the nearest color of the main background color.
View 2 Replies
Apr 6, 2009
I have the following:
function ShowSlide(event:TweenEvent) {
m= getChildByName("tag"+slideIndex+"_mc");
m.visible = false;
if (slideIndex < 4) {
slideIndex++;
[Code] ....
And I want to do for "tagInitW" the same thing I do for "m" being given that I already have "created tag1InitW", "tag1InitH", "tag2InitW", "tag2InitH..." So is there anyway I can dynamically target a variable? This was easy in AS2, but because of the strict dataType the vars have in AS3, I can't do it like I was doing it in AS2.
View 4 Replies
Sep 23, 2009
I'm writing a graphics-intensive game in Flash CS3 / ActionScript 3. Is there any code profiler I can use to identify bottlenecks in the code?
View 4 Replies
Oct 30, 2009
in ActionScript 3, if I loop through the children of a movie clip, it will return a DisplayObjectContainer, which is a list of DisplayObjects. However, the AS3 typeof cannot identify MovieClip as MovieClip is now an object, instead of a data type. How can I correctly identify MovieClip?I found 3 solutions online: First set the MovieClip name to a specific name, then in the iterate process, check the name of children using child.name.indexOf("specificName") > -1
Solution 2:use child.hasOwnProperty("numChildren") to identify a MovieClip
Solution 3: use 3rd party plug-in like FlashDevelop
View 2 Replies
Mar 17, 2010
I am creating a lot of dynamic flex components like RadioButton, Combo Box, CheckBox.
[Code]....
When i click on Submit finally i need to get all the selected Values in each question. All the components are dynamically created at runtime.
View 1 Replies
Jun 23, 2010
How do we identify the user's web browser in flex ? Based on the browser I have to display some text in my flex application.
View 3 Replies
May 13, 2011
Basically, I'm making a very simple turn based battle game using ActionScript 2.0. I'm VERY new to code, with only very limited Visual Basic knowledge, so I'll happily admit I don't really know what I'm doing. I've got a start, but I decided to rewrite the entire thing because I wouldn't be able to cycle enemies and levels easily.I've spawned the same enemy twice using _root.attachMovie, and identified them as Enemy1 and Enemy2. After spawning them, I tried to make them identify themselves with:
_root.Enemy1.identify = "Enemy1"
_root.Enemy1.identify = "Enemy1"
Using the debugger, this apparently works (within the movieclip, they have a variable called identify which correctly labels them), yet when I try to use an if statement so I can put them in their own individual positions, it simply does not work; it skims straight over. The code I have within the movie clips is:
if (identify == "Enemy1") {
function poschange() {
[code]....
The poschange functions works fine for the player characters, it's just this if statement to identify which enemy it is apparently fails. So my question is: is there any easier way for a movie clip to identify its own ID so I don't have to use this method, or is there just something wrong with my code?
View 1 Replies
Jun 21, 2011
How can I get to know that the device is iphone or ipad using actionscript3.0?
View 1 Replies
Dec 13, 2009
I have three buttons on stage (type button) How can i identify wich button i have clicked.
[Code]...
View 1 Replies
Mar 17, 2007
We'll call it "song" for the sake of example...song has the attributes artist, title, album. upon makign all the objects, i put them in an array.[code]...
whether i want to find one object that has a unique attribute (like "london bridge", maybe) or multiple objects that might have the same attribute (like an artist or album), is there a more efficient way?
View 6 Replies
May 14, 2008
I am developing a Flash application which should initially (before launching the main application) identify the internet bandwidth available on users system and display low or high bandwidth content accordingly.If the user has dialup concetion then I need to display only images else if it is broadband concetion then I need to display swf's along with the audio.
View 1 Replies
Sep 14, 2009
Further to my earlier posts about identifying and manipulating clips and subclips created in a for loop, I'm sure I'm still not using the best methods of identifying any given clip or it's nested subclip. The following works, but I understand that naming clips and using getChildByName are not best practice.
However it seems to me that using getChildAt could be cumbersome to keep track of, particularly if clips were to be added, removed or swapped during the course of the program.
I expected that clipArray[2].weeBox would have been sufficient to target that subClip in the object referenced in the third slot in that array, but that's clearly not the case. Is this it, or is there a better approach?
[Code]...
View 6 Replies
Feb 9, 2011
i saw that my app after some time, it becomes slow.. so i guess i have a memory leak? How could i be sure about that and track it down?
View 2 Replies
Sep 23, 2009
for (var i:int = 1; i <= 8; i++) {
this["b" + i].visible=true
}
I am wondering whether I can set all b1,...b8 movieclip to visible except b7?should I identify each movieclip to visible each or a script can be written in 1 line?
View 1 Replies
Jun 23, 2009
I have an app that uses several Loader objects to load extenral swf files. Things go well except for one point. I have a quiz element that's loaded through a loader named 'quiz'. When the quiz is done, I remove the quiz element with removeChild(quiz). The quiz disappears from the screen every time except for one question. I can't identify what's going on differently for that question. I've debugged this and can see that my quiz object is set to null, but I can plainly see the quiz still onscreen.
To further confuse me, I use the same loader object multiple times through the app, and just add it and remove it from the display list with addChild and removeChild. When my one problem question comes up and fails to go away, the app continues to the next question, and I can see that there are now 2 quiz objects stacked on top of each other. I have no idea how this can happen when I'm using the same loader object for all the questions.
[Code]...
View 1 Replies
Jun 18, 2010
I'm trying to make a vote/poll application in Flash using Actionscript 3. Is there any way to generate a specific ID that is unique to each user? The only other option I can think of is using the IP address, which is less than ideal in many cases (college campuses, shared Internet access, etc.). It needs to be the same number every time it is run on the same PC, but different for each user.
View 1 Replies
Apr 11, 2011
I have tilelist, which is dynamically loaded XML file with pictures,How do I do that would be when you click on a picture in the Label gave her name?
<mx:TileList id="tileList"
alternatingItemColors="[#FFFFFF,#EEEEEE]"
dataProvider="{xmlListColl}"
[code]......
View 1 Replies
Jul 31, 2011
I am trying to retrieve mysql data using php(products.php) and return the data in xml format to ADobe flash as3; but i am getting following error.[url]...
I have WAMP installed; which works fine as i have many other php projects working here.[code]...
View 2 Replies
Oct 10, 2011
As in Java I want to know if my reference is declared as Interface.
function foo(classRef:Class){
if(classRef.isInterface(){
//something
[code].....
View 2 Replies
Oct 25, 2011
I have written a script where a MovieClip instance is created at the mouse cursor position. It creates the instance and everything is fine.
ActionScript Code:
function createMarker(event:MouseEvent)
{
var newMarker:marker_mc = new marker_mc();
[Code]....
But I would like to drag and drop those markers after creation. Also identify them. Because currently the have all the same name. Is there a way to give them an dynamic id?
View 6 Replies
Oct 13, 2010
In my case I have 6 movieclips and 6 corresponding text fields (all 12 objects are on the main timeline) and the movieclips are named thumb1_mc, thumb2_mc, etcetc, and the text fields are named text1, text2, etcetc.I have a method:mcl_mcl.onLoadProgress = function (targetMC, loadedBytes, totalBytes)in which I need to change the appropriate text file's text depending on which movieclip is targetMC.The trouble is I can't find a way to distinguish which mc it is, so I can't pick which text file to change.I tried using properties but that doesnt work because everything about the movieclip gets obliterated the moment I load something into them.
View 4 Replies
Jan 27, 2010
How I should get started to achieve two things. I am creating a map with places and routes between those places.
Objective 1: When a visitor hovers over a place name, I want a tooltip to show, which they can select to be taken to another html page to display information on that place.
Objective 2: When a visitor hovers over a line or path connecting two places, a tooltip shows to identify that route, and again when the tooltip is clicked, the visitor is taken to the route details html page for further information. I want the tooltip to show up anywhere along the path which is hovered over.
I want to know, how I should start to design this and what elements will be required to achieve this, especially the tool tips. And how easy is it to make a path highlight, like a button, when hovered over, can a path have different states?
Here is a image done in Fireworks of my objectives.
View 6 Replies
Jul 3, 2011
I've coded a 2000 line game on one actions layer (facepalm*) and I just recently learned about the GC (garbage collector). I've looked around a bit and can't, how to trace the source of it. There is an interesting article that mentioned event listeners and for every addEventListener there should be a removeEventListener. My game has 60 adds and only 15. What I can't make sense is that the mc's that have the event listeners are never removed, but just moved off of the stage. Others are just made invisible. So if the event listener is added once, why would the memory keep growing? (I'm using the Windows Task Manager to monitor this). Another point was to remove objects so that the GC can do its work. What I did was create an object, add it to an array then null it.
_object1 = new _barrel();
_object1.x = objectPosition;
_object1.y = _defaultFloorBoundary.y;
instanceArray[objectNumber] = _object1;
_object1 = null;
Then removed the object from the array.
for ( var ii:int = 0; ii<instanceArray.length - 1; ii++ ) {
stage.removeChild(instanceArray[ii]);
delete(instanceArray[ii]);
instanceArray[ii] = null;
}
View 1 Replies
Nov 30, 2010
I'm using BlazeDS to send messages in Flex. Inside the UI component, I defined a producer like the one below:
<mx:Producer id="producer"
destination="chat"
fault="faultHandler(event);"/>
I was wondering inside faultHandler how I'm able to identify what message causes the error. As it seems there's no way to get the reference to the original message.This is the code snippet how the message is constructed and sent.
private function sendMessage():void {
var message:AsyncMessage = new AsyncMessage();
message.body = userName.text + ": " + input.text;
[code]....
View 1 Replies