ActionScript 2.0 :: LoadVars - Grab The Number Of Variables?
Apr 20, 2004I'm trying to grab the number of variables I'm loading using LoadVars.
View 5 RepliesI'm trying to grab the number of variables I'm loading using LoadVars.
View 5 RepliesI'm trying to grab the number of variables I'm loading using LoadVars.
View 5 RepliesI have some buttons named bt1, bt2, bt3 etc
They have a common function for when each is clicked called buttonclicked.
Within the function buttonclicked, I'd like to grab the number off the end of each button name so that I can compare the number to a global variable I have called global.data.clicker
so...
if (number at end of event.target.name == global.data.clicker) {take action...
Is it possible, and if so, what code do I need to put in the first part of the if statement to make it work?
Var.ball:MovieClip
Ball.y = 0
Var moveArrayY:Array = [5, 13, 2, 6, 7, ]
Var GameSpeed:Timer = (??? 1 second???)
I'm trying to
1. Move this object based on the next array position
2. Wait for GameSpeed to cause a 1 second pause
3. Move this object based on the next array position
4. repeat steps
the direction, or throw me some code on how to grab a certain number of characters, or words from a variable
View 4 RepliesI have a project that works quite beautifully right now. I have come to my next task. Creating swfs that are loaded into another swf. This newly loaded swf needs to grab some variables from the main swf's document class or global variables class that I have created. I have set the class path as such that it can access the classes as needed. I did not set a document class.
Structure of loaded swf:
core.swf -> loadedBackground.swf -> interactive.swf
1.) Classes are all located in a folder titled classes
2.) cores.swf is outside the classes folder and is linked to document class within the classes folder: BuildCourse.as
3.) swfs folder contains the loadedBackground.swf and interactive.swf
4.) How can interactive.swf grab variables from the main.swf after it is compiled?
I need to send a variable (zipcode) to a coldfusion script and also load the cf page that displays the results (same script) in the browser window (_self) is getURL the appropriate choice for this? (never done it this way before). if so, does using POST in a getURL just grab any variables on the _root? where does it get its variables?
View 3 RepliesI have an .SWF that is a "Share With A Friend" and the text fields are filled in and then the SWF sends the variables to sendToFriend.php and then the email is sent out.. The PHP is working fine and I have all the right codes to send that information from the SWF to to PHP, but the client wants another feature I can't figure out..
They want me to grab data from an XML and use those variables as well, because the XML will have the USER EMAIL and I need to grab the specific data from the XML and I can't find anything that does this..
I barely know where to start. Maybe a simple tutorial that doesn't just load the XML and display the content (I have found that), but rather something that loads the XML, then refers to a specific child and turns the text to a variable to get sent to PHP..
EXAMPLE XML
<client>Joe</client>
<email>JOE@JOE.com</client>
How do I load the XML and directly refer to the <email> information so my PHP file can grab "JOE@JOE.com" ???
I got a request today conserning .txt files.What I want to accomplish is to grab information from a text file and save them in variables (or an array, depends).Whats the best way to do this, and whats the do's and don'ts?I'm planning to use the LoadVars class to pass the variables through and i've got a working test, but isn't there a more efficient way to do this?
View 9 RepliesI am developing a module that will run on a CD-Rom as a projector. It needs to post small amounts of data to an online URL to facilitate tracking.Consider this:
Code:
var myVars = new LoadVars();
myVars.username = _root.userName;
myVars.email = _root.emailAddress;[code].....This works fine, unless the user's computer is behind a corporate proxy server, which is specified in the Internet settings of the browser. My question.....Is it possible to specify a proxyserver (and port number) using Loadvars and SendAndLoad from a Projector EXE?
I'm experimenting with loading an array of elements into my Flash project using the LoadVars property (I'm using Flash 8 - AS 2) The elements are queried from MySQL using PHP to a page named "elements.php" and loaded into the Flash file. It works fine, but I'd like to be able to protect the "elements.php" page so that the variables queried from this page cannot be viewed by someone who types the absolute path to the elements.php file in the browser address bar [[URL]. Using includes, I'm able to protect other pages in my site from direct assess but these methods don't seem to work when the URL is called from within my SWF file.
My fear is that someone might decompile the swf to reveal the LoadVars URL present in the actionscript. I know there are ways to obfuscate the code, but I'm not sure how well these methods really work. I also understand it is practically impossible to completely hide the code from someone who is REALLY intent on getting it, but I'd like to make it as difficult as possible.
I have a php page which outputs the following:
DisplayValue=%3cfont+face%3d%27Arial%27+color%3d%2 7%23FFFFFF%27+size%3d%2730%27%3eGambling+Hotline+1
[code].....
I have an application that reads a PHP script and populates the Flash applets using the following on frame 1:
[Code]...
A combobox (created with the returned data) is created on frame 61. When a selection is chosen in the combobox I need to add the value returned from the combobox to the variable catvar, add this variable to the LoadVars object and run the script again. It seems to set c.catvar initially but when I use the 'sendAndLoad command the second time c.catvar isn't included. Is it possible to add variables to a LoadVars object created
on frame 1 from frame 61?
use loadVars to read variables from .txt files on a different server with flash, do any of you know because I'm getting really annoyed?
View 14 RepliesI am using the following code to send some values do a php file. The problem comes when i actually SEND them (values). A browser opens up. How could i avoid opening the browser when i send my variables to my php?
[Code]...
I am trying to obtain the variables/contents of a php or a text file from my server using loadVars(), and the problem is that flash can get data from almost every server but from mine. (some shared hosting service) I just tried the code provided in the help files:
Code:
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if (success) {
[code]....
I'm sure that I did no mistake in typing the URL, for it works fine in the browser (also no spaces, no freaky chars), and when i change the URL to another domain (and put the txt file on that server) everything works fine. I tried both possibilities "network access" and "local access" as well as running from an exe projector. But no chance.
i am trying to do a loop to create several variables to aasign each one of those variables one number.when i write
[Code]...
There seems to be a problem with Firefox 2.x sending variables to PHP scripts with the LoadVars.send/POST method.
<br>
The same problem doesn't occur in IE or Opera. <br>See this url for example to try in both FF and IE/Opera: here. <br>The source files are here g.zelenka@iinet.net.au
One of the moderators, could you've a look at this tutorial: [URL] it doesn't works with me, maybe because I've 2004 so if you change loadVars() into LoadVars() it should work
View 2 RepliesI would like to use a different symbol other than the "&" operator to seperate my variables in my loadVars...
View 5 RepliesWhenever i try to display anything returned by LoadVars.getBytesLoaded or Load....Total, it gives me NaN.
View 14 RepliesI have a bunch an as3 game going. In my game when newCrag hits egg_mc the score gets added.
[Code]....
I have a common problem trying to obtain a Number from an xml file.I have found several people with the same problem but I didn't succeed in finding a real solutionThis is my code
Code:
itemp = xmlCity.childNodes[2].childNodes[0]
trace("1. init : " + typeof itemp)
[code]......
I'm trying to import some variables set up in a .txt file. However the variables that I would like to behave like numbers are not doing so.
I have a variable in the text file called "&middleimg=1" when I pull this in and say do the following:
Code:
var numvar:Number=0;
numvar = _root.myvars.middleimg+1;
I get "11" rather then "2" as the result. I tried setting up my text file as such: "&middleimg:Number=1" but get an "undefined" result. Is there anyway to get imported variables to behave like a number instead of a string?
I'm trying to load a known number of variables. So I set up this code in flash[code]...
View 1 RepliesI'm trying to load a known number of variables. So I set up this code in flash[code]...
It recive "antal"which is how many variables there are. The variables name are named produkt_0 produkt_1 produkt_2 produkt_3 and so on..
So it collect the varibales correct i've checked this by set loader.data.produkt_load to loader.data.produkt_0. But since I don't know how many I just can't set loader.data.produkt_load to loader.data.produkt_0. Insted I want produkt_load be a variable like it is in my code, but it seems that loader.data.produkt_load became undefined, why this? Can't you set a variable that change in loader.data.hereismychangingvariable?
it's just some little white 'snowflakes' that fall from the upper end of the screen)
ActionScript Code:
var timer:Timer = new Timer(30);
timer.start();
timer.addEventListener(TimerEvent.TIMER, onTimer);
[Code]....
Now, this of course gives a run time error (access of undefined property snowSpeedX) due to the fact that snowSpeedX is declared in the function onTimer. The reason it is declared their is because i want it to change everytime and so each snowflake that falls, moves in the x axis with a different speed. If i declared the snowSpeedX variable outside of the onTimer function, i wouldnt get a different value for every snowflake, i would just get one.
So, how do i get the snow flakes to have a varying range of speeds?
Having some issues with some variables not adding together to make a new number. Instead they are appending to each other as if adding characters onto a string rather than a number. Here is my code.
ActionScript Code:
var dispenserPos:Object = {x1:"41", y1:"180", x2:"283", y2:"180", x3:"530", y3:"180", x4:"775", y4:"180"};
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
[Code] .....
It should be tracing out 388 instead of the numbers appended onto one another.
i wanted to a load unknown number of variables from a text file
View 1 RepliesI have an XML file i'm importing into Flash then creating a variable value called 'xmlMonth'...if I trace this value I get '5' so I know its getting imported ok. The problem I'm having is when I try to create a new Date with this value, my bits of code look like this...
[Code]....