Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Passing/Storing/Retrieving Variables


Hi all!

You may have seen posts from me regarding a click & find game I am working on. I have a new question, based on the same project. Here is the scenario:

There are 6 different movies that will be played only once during the game (the pattern or playlist is random based on which button the user clicks 1st, 2nd, 3rd, etc.) Is there a way to pass a variable from each movie (once it is played) to one central container, where they are stored until it is filled with six variables, and when filled it will play a new movie?

I am not very familiar with passing variables, so don't know if this is possible or if this is the right function/approach?

Any thoughts would be greatly appreciated!!!

You all rock!!
Abell1973




FlashKit > Flash Help > Flash ActionScript
Posted on: 03-18-2003, 02:28 PM


View Complete Forum Thread with Replies

Sponsored Links:

Problem With Storing And Passing Variables
Can anyone help with a problem with variables?

I've created a map with a zoom feature. As the user zooms in, the map scales and repositions itself so that it stays centred. The map is also draggable.

The problem is that I can't get the map to reposition itself on zoom out. Also, because the map can be dragged the x and y co-ordinates are not fixed, they are relative.

I think the best way to do this is to pass a variable so that the map can be repositioned relative to it's size. This works on zoom in but not zoom out.

Any help would be really appreciated.

Here's the Actionscript for the zoom slider, whcich is actually a row of buttons which the slider goes beneath.


on (release, dragOver) {
tellTarget ("/SlideMe") {
gotoAndStop(5);
}
setProperty("_level0/Map", _xscale, 140);
setProperty("_level0/Map", _yscale, 140);

if (newsize < 140) {
newx = (getproperty("_level0/Map", _x)-"28.7");
newy = (getproperty("_level0/Map", _y)-"33.25");
setProperty("_level0/Map", _x, newx);
setProperty("_level0/Map", _y, newy);
}
else {
newx = (getproperty("_level0/Map", _x)+"28.7");
newy = (getproperty("_level0/Map", _y)+"33.25");
setProperty("_level0/Map", _x, newx);
setProperty("_level0/Map", _x, newy);
}
}


And here's the code for each frame of the "SlideMe" movieclip which is the mc containing the zoom slider.

stop();
newsize = "140";


I think the problem lies with global variables being set incorrectly, but any help is greatly appreciated.

View Replies !    View Related
Problem With Storing And Passing Variables
Can anyone help with a problem with variables?

I've created a map with a zoom feature. As the user zooms in, the map scales and repositions itself so that it stays centred. The map is also draggable.

The problem is that I can't get the map to reposition itself on zoom out. Also, because the map can be dragged the x and y co-ordinates are not fixed, they are relative.

I think the best way to do this is to pass a variable so that the map can be repositioned relative to it's size. This works on zoom in but not zoom out.

Any help would be really appreciated.

Here's the Actionscript for the zoom slider, whcich is actually a row of buttons which the slider goes beneath.


ActionScript Code:
on (release, dragOver) {
    tellTarget ("/SlideMe") {
        gotoAndStop(5);
    }
    setProperty("_level0/Map", _xscale, 140);
    setProperty("_level0/Map", _yscale, 140);
   
    if (newsize < 140) {
        newx = (getproperty("_level0/Map", _x)-"28.7");
        newy = (getproperty("_level0/Map", _y)-"33.25");
        setProperty("_level0/Map", _x, newx);
        setProperty("_level0/Map", _y, newy);
        }
    else {
        newx = (getproperty("_level0/Map", _x)+"28.7");
        newy = (getproperty("_level0/Map", _y)+"33.25");
        setProperty("_level0/Map", _x, newx);
        setProperty("_level0/Map", _x, newy);
        }
}


And here's the code for each frame of the "SlideMe" movieclip which is the mc containing the zoom slider.


ActionScript Code:
stop();
newsize = "140";


I think the problem lies with global variables being set incorrectly, but any help is greatly appreciated.

View Replies !    View Related
Storing And Retrieving Vector Shapes
Hi there.

I really hope someone can help me. Im working on a viral Flash application, which involves a painting tablet where users can draw on the stage. Once they have finished their picture, they have the option of sending an e-mail to their friend, which will contain a link to the Flash file, and on loading, it will display the drawing that the first user made. The second user can then add to this drawing if they want.

Basically I need to know the best way to get variables to and from each user, and also how to put the users drawing into a form that can be sent as a variable and then redrawn and viewed by the second user.

Hope that isnt asking too much
Many thanks

View Replies !    View Related
Retrieving And Storing Radio Button Value
Hi all, I have a set of radio buttons which i need to retrieve the value from, store the value and pass it on to the next scene. I have tried using radio_btn.data, but it doesnt work. Can anyone help me with this?? Thanks!

View Replies !    View Related
Storing/retrieving Color Data.. Php
okay, so i have a basic drawing app based on http://jerryscript.hostrocket.com/fl...wing2JPEG.html which looks something like this:

Quote:




drawing = false;
data = '';
_global.linethickness = "2";
_global.linergb = "0xFF0023";
_global.linealpha = "80";

with(_root){

onMouseDown=function(){
if(_root.board.hitTest(_root._xmouse,_root._ymouse )){
drawing=true;
xposition=_xmouse;
yposition=_ymouse;
moveTo(xposition,yposition);
}
};

onMouseUp=function(){
drawing=false;
};

onMouseMove=function(){
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);

if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
_root.data+=xposition+'_'+yposition+'_'+_xmouse+'_ '+_ymouse+'-';
xposition=_xmouse;
yposition=_ymouse;
}
updateAfterEvent();
};

}}
send.onRelease = function ()
{
getURL('create-swf.php', '_blank', 'POST');
};




when 'send' is pressed, it loads a php script which retrieves the line data and redraws it thanks to MING like:

Quote:




$data=$HTTP_POST_VARS["data"];

$movie=new SWFMovie();
$movie->setDimension(500,300);
$movie->setBackground(255,255,255);

$s=new SWFShape();
$s->setLine(1,0,0,0,255);

$lines=explode("-",$data);

for($l=0;$l<count($lines)-1;$l++){

$lineData=explode("_",$lines[$l]);
$s->movePenTo($lineData[0],$lineData[1]);
$s->drawLineTo($lineData[2],$lineData[3]);

}




works fine.
problem is, i can change the colour and tha alpha and the linethickness in the flash bit (changing the 'line...' variables) but i cant figure out how to store the different info and then bring it back in the php file..

anyone help?
stuck.

View Replies !    View Related
Storing/retrieving Color Data.. Php
okay, so i have a basic drawing app based on http://jerryscript.hostrocket.com/fl...wing2JPEG.html which looks something like this:

ActionScript Code:
drawing = false;
data = '';
_global.linethickness = "2";
_global.linergb = "0xFF0023";
_global.linealpha = "80";
 
with(_root){
 
onMouseDown=function(){
    if(_root.board.hitTest(_root._xmouse,_root._ymouse)){
drawing=true;
xposition=_xmouse;
yposition=_ymouse;
moveTo(xposition,yposition);
    }
};
 
onMouseUp=function(){
drawing=false;
};
 
onMouseMove=function(){
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
 
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
_root.data+=xposition+'_'+yposition+'_'+_xmouse+'_'+_ymouse+'-';
xposition=_xmouse;
yposition=_ymouse;
}
updateAfterEvent();
};
 
}}
send.onRelease = function ()
{
    getURL('create-swf.php', '_blank', 'POST');
};

when 'send' is pressed, it loads a php script which retrieves the line data and redraws it thanks to MING like:

PHP Code:



$data=$HTTP_POST_VARS["data"];

$movie=new SWFMovie();
$movie->setDimension(500,300);
$movie->setBackground(255,255,255);

$s=new SWFShape();
$s->setLine(1,0,0,0,255);

$lines=explode("-",$data);

for($l=0;$l<count($lines)-1;$l++){

$lineData=explode("_",$lines[$l]);
  $s->movePenTo($lineData[0],$lineData[1]);
  $s->drawLineTo($lineData[2],$lineData[3]);






works fine.
problem is, i can change the colour and tha alpha and the linethickness in the flash bit (changing the 'line...' variables) but i cant figure out how to store the different info and then bring it back in the php file..

anyone help?
stuck.

View Replies !    View Related
Storing And Retrieving Data From A Flash Form.
After spending most of the morning reading through previous threads on this topic, i have yet to find one which will help me out.

I have been asked to make an application for a mate that will store user input data and also retrieve it. I consider myself an above average flash user but when it comes to server side scripting i have no idea where to start. I know that to accomplish this i need to use either ASP or PHP etc and intergrate that with a database ? if i'm going off track please correct me.

So say i have 4 fields for the user to input data into:

ID Number:

Client:

Description:

CD Number:

Once done this info is saved to the database.

Then if the user wants to retrieve this info again, he/she enters data into either of the 4 options above and then the rest of the info is brought up from the database. Is this possible to do using Flash ASP/PHP and an access database or am i going totally off track ?

View Replies !    View Related
Storing And Retrieving User's Personal Details In A Chat Application....
Hello all,

I have a general question regarding storing and retrieving a user's personal details inside a chat application.

IE: There are 4 users in a chat room. Each of these users will have set of databased details. (age, sex, location, sexual preference, and a personal quote) When you click on a user on the List Box of the application, the users personal details should be available to be viewed.

I am curious what the community thinks (1)would be the best way to retrieve this info from the database, (2)how to pass this info to the flash com server's shared object.

My initial thought was to retrieve this info. from the database on a php page through a set of flash variables, which would be available variables in the session variables. Which would then be stored inside of flash as a set of variables (userDataAge, userDataSex, etc.). But, this is where i am stumped. How would you send these variables to the flash com server's shared object?


I think I have explained this well, if I am unclear, let me know.

Thanks ahead of time,
J_Monty

View Replies !    View Related
Passing/storing Information Through Forms
Hi,

I wanto create a form but divide it up into 5sections.
So section 1, and box pops up and asks for your name. Then you press enter and it disappers and Then section 2, a new box pops up and asks for email etc...
Then at the end all this info is sent to an email address.
How is this done?
Thanks

View Replies !    View Related
Retrieving Variables
In my flash application, I have 3 main sections where there are 3 lots of questions and puzzles, the data for these sections are retrieved from 3 individual java servlets.

Implementing the first two worked fine, however when I came to call the 3rd servlet for the 3rd section of questions, flash went into a looping frenzy and wouldn't retrieve the data, although the data was being sent (I'm sure of this through debugging).

Is there is a limit of information flash can retrieve and store because when i reduce the amount of information being sent to flash in the 3rd section, it works perfectly? (bearing in mind i'm not refering to an incredibly huge amount of data.)

Also would you recommend I split these sections into external swf's then load them one at a time, or is this just amounting to the same problem in the end.

Any help or advise would be really appreciated!!

View Replies !    View Related
Retrieving Variables
Anyone know how to pull a Lasso (or PHP) variable into flash MX 2004?

View Replies !    View Related
Retrieving Variables
Hi,
If i have a swf on _level0 and i load another swf onto to _level1 how do i go about passing variables.
For example i set a variable in the swf on _level0 like:
code:
var old_id = 1;

How do i retrieve this var so i can use it again in my other swf on _level1?
Cheers

View Replies !    View Related
Retrieving Variables From PHP.
Hi! I've just started to learn AS3 and I found out that I had to use some new methods to retrieve data from PHP. And now (of course) it doesn't work

My AS3 code looks like this:

Quote:




//Create the URLLoader instance
var myLoader:URLLoader = new URLLoader()

//the data will come as URL-encoded variables
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES

//Load using an URLRequest, even beeing local
myLoader.load(new URLRequest("http://magnusvs.net/flashgalleri/connectToDb.php"))

//onLoad handler listener
myLoader.addEventListener(Event.COMPLETE, onDataLoad)

//add a listener for the complete event
function onDataLoad(evt:Event){

if(evt.target.data!=""){
trace(evt.target.data["id0"]);
}
}




The structure of the string that the php code echoes is like this:

Quote:




&id0=1&navn=asdasd&id1=1&navn=dffhr




When I run the AS3 code, I get this error code:

Quote:




Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader:nComplete()




If I remove
Quote:




myLoader.dataFormat = URLLoaderDataFormat.VARIABLES




and just trace
Quote:




evt.target.data




(not a specific variable), I get the entire output, but just as a string ofcourse...

Does anybodt know how I can retrieve separate variables/being able to loop through the output variable by variable?

View Replies !    View Related
Help With Retrieving Variables
Hi ! I am a VisualBasic .Net programmer and on my new program I want to retrieve data in flash (data that is sended through visual basic). For example I want to make a dynamic text in flash having a variable (Var: dataVar). I am able to change that value trough visual basic for example making the variable 1 or 2, but what statement do I have to write so that flash always reads that value and causes a command (in this case i want the stage framerate to change everytime the variable changes, for example if I send the variable 1 from visual basic the stage framerate should be 10 fps, if I send 2 from visual basic the stage framerate should be 20 fps, and so on). I am also having difficulties in using the stage.frameRate command in actionscript 3.0. Highly appreciated if you could write the code for me or if there is a more simple way for doing this. Thank you.

View Replies !    View Related
Retrieving Get Variables
gooday, its me again :)
i dont know if anyone asked that question

given a URL passing some get variables such as
http://mysite.com/mypage.html?myGetVar1=blar&myGetVar2=blarblarblar
mypage.html embbed a mypage.swf
(please note that mypage.html, not mypage.swf)

how can i retrieve without using any thirdparty component/script??
especially flash var and swfObject

thankyou

View Replies !    View Related
Retrieving Variables From Php..
okay, so i kinda understand how to POST to my php file from a flash-form
but could someone give a quick example of the other way round,
how to set up variables in a php-file and read them from an AS-file

sry, php-noob

thanks /bon

View Replies !    View Related
:) Storing Variables In LAN
Ok, how do i store vars/text into TXT file that is on computer near me in LAN.

I can get them by

//name/squeek/a.txt

how do i return them

Either Javascript, EXEC or plain Flash actionscript will do

Bye

View Replies !    View Related
Storing Variables In The Exe
I am creating a flash exe that I would like to distribute. This exe will allow the user to enter data into text fields.
I would like to know if I can store the data the user enters and include it with the exe so the next time the user opens the flash exe, the data still exists. I have gone down the path of setVariables to a txt file and then loadVariables, but would rather not have to include a txt file.

Any ideas?

View Replies !    View Related
Storing Variables
Hello all. Does anyone know how I can store variables input by user via a text field from one swf to another? I think I need to explain this: I am doing an order form where swf's which are the actual order forms are being loaded on top of one another. When the user inputs quantity I want that quantity to be stored in another swf. Then when the user is finished they would get a preview page that would show them what they ordered and when they click a submit button it would send all the info to a php fscript that would send it via email. I have the php script and it works I just need a way to have variables passed from one swf to another, stored and then all be sent to a php script..anyone who can help thank you!

View Replies !    View Related
Storing Variables
Hello all. I have posted up this problem yesterday but I think the way I am wording my problem is confusing and I think it's because I am confused! What I am trying to do is create a swf that acts like a pseudo order form except all the data is being sent to php script and then to someone via email. I have allot of text input text fields all with unique variable names. I need a way to store the input data across different MC's until the end when the user hits submit and then it will go to the PHP script. How can I do this?

View Replies !    View Related
Storing Of Variables
Hi guys can any one recomend me efficent way of storing n applying changes to variables?

View Replies !    View Related
[F8] Storing Variables HELP Plz
Been having trouble with this all night..
Flash animation is an order form with 5 steps consisting of 5 frames.
Each frame has it's own movie clip with input text boxes with assigned variables to each.

When the customer puts in their name, address, etc in frame 1 they then click "next" to go to frame 2 where they will put in their delivery time, etc.

Let's say they are in frame 2, but now they want to go back to change their address details, they click the "back" button to find that all the input text boxes are BLANK.

How do i fix this so their details are still stored there?

And then finally, once they have filled out all their info, how do i display all their inputted text - order details, etc on the last page where they make payment.

I'd appreciate any help right now Thanks

View Replies !    View Related
[CS3] Storing Variables
I'm trying to do an online questionnaire in flash, and I want to store an average of user's scores somewhere so that I can compare a new user's score with the current average.

I've done some minimal investigation and it looks like I'll need to crate a text file to store the average, which will be updated using a php file. Is this the best way to solve the problem?

Cheers

b

View Replies !    View Related
Storing Variables
Hey, I've got a few applications that require a lot of statistics and data to be brought in.

Right now I have a huge class that is doing all the remoting calls, and is acting kinda like a just container cause it is also storing all the brought in data. Now I'm not using very must RAM, but I was wondering if the little RAM i am using now would be brought down if I where to store those statistics inside of a Shared Object inside of inside of a class (as properties).

Just to give an example of how many values I'm talking about. 50 of the properties inside of my huge class are arrays, each having up to 20 values inside of them.

So I guess my question is, do share objects hold inside a computer's memory, or is it help on their hard drive? So would it make a difference as far as how much memory I would be saving using Share Objects inside of Properties of a class to store values.

View Replies !    View Related
Storing Variables In SWF. Help Me Pls
Sorry I'm in a bit trouble.. I've just made all the stuff but now the fresh obstacles arise on the way. I want to make an online coloring competition. The user redirected from homepage to another page to start the coloring. The line sketch of the picture is displayed there and with a palette to pick the color and paint the picture. EVerything is working fine. The problem begins comes after the user can send SWF back to the co-ordinators to evaluate the result. That process is using ASP. After getting the swf back we won't get the user inputs in that file just 'cause all the variables cleared with a previous value (only we can see the line sketch instead of a colored object)

I'm really frustrating and no solution comes in my head. Help me pls

View Replies !    View Related
Storing Variables From Php
Hi, i'm trying to make a shoutbox/guestbook for my site in flash but i'm running into this problem. I'd like to have some sort of ip check, and i've got flash loading a var from php, and when I assign a text field the variable the users ip shows up just fine. my question is this-

how do i save whats in said text field as a string or something to use?

View Replies !    View Related
Storing Variables In SWF. Help Me Pls
Sorry I'm in a bit trouble.. I've just made all the stuff but now the fresh obstacles arise on the way. I want to make an online coloring competition. The user redirected from homepage to another page to start the coloring. The line sketch of the picture is displayed there and with a palette to pick the color and paint the picture. EVerything is working fine. The problem begins comes after the user can send SWF back to the co-ordinators to evaluate the result. That process is using ASP. After getting the swf back we won't get the user inputs in that file just 'cause all the variables cleared with a previous value (only we can see the line sketch instead of a colored object)

I'm really frustrating and no solution comes in my head. Help me pls

View Replies !    View Related
Storing Variables In SWF. Help Me Pls
Sorry I'm in a bit trouble.. I've just made all the stuff but now the fresh obstacles arise on the way. I want to make an online coloring competition. The user redirected from homepage to another page to start the coloring. The line sketch of the picture is displayed there and with a palette to pick the color and paint the picture. EVerything is working fine. The problem begins comes after the user can send SWF back to the co-ordinators to evaluate the result. That process is using ASP. After getting the swf back we won't get the user inputs in that file just 'cause all the variables cleared with a previous value (only we can see the line sketch instead of a colored object)

I'm really frustrating and no solution comes in my head. Help me pls

View Replies !    View Related
Storing Them Variables?
hi,

I have some true or false variables inside of a mc, so people can go in and make a selection. But the problem is, when they leave that mc and return to the main timeline/stage, the variables are lost, set to none again.
So, my question is, how do I store them so they don't disappear when they return to the main stage?

any help appreciated

Al

View Replies !    View Related
[as] Storing Variables
HI!

Lets say I have a couple of duplicated clips wich are draggable. After placing them on the screen i would like to store their _x and _y properties (possibly in an array) with a button. How do I do that?

View Replies !    View Related
Delay In Retrieving Variables
i'm fairly experienced with php / mysql, but pretty new to flash. i'm working on a game that relies heavily on a database and so far i'm not having too many problems integrating the flash with php / mysql (i've been using AMFPHP for this), but i keep running into one problem. i'll make a call to the database to retrieve a variable, then tell the flash to go to some other frame which uses the variable...

because the time between frames is miniscule and the time it takes to actually get the variable out of the db and return it generally takes a second or two, the frame will load and the variable is undefined. to kind of counteract this, i've made a frame called "process" and in the code for that frame put the code:

if ( var==null ) {
gotoAndPlay("process");
} else {
gotoAndStop("nextFrame");
}

for some reason this doesn't always work, and sometimes it advances to nextFrame even while var is still null... to deal with that i added the line

if(var==null) { gotoAndPlay("process"); }

to the top of nextFrame.

while this solution seems to more or less fit... i doubt it's the best way to go about it. and seeing as how this is going to be a fairly large project, with A LOT of calls to the db (like, inbetween every single frame) this doesn't seem to be very practical. are there any other solutions? thanks...

View Replies !    View Related
Retrieving Variables From A MovieClip
Hiya. I have a movie clip of a clock in my movie, and it contains variables with the current time. I would like to retrieve variables from this movie clip using ActionScript on a frame on the main timeline.

How would I go about doing this? Here is my code for the first frame of the movieclip if anyone's interested:


myDate = new Date();
//dateTextField = (mydate.gethours()+":"+myDate.getMinutes()+":"+myd ate.getSeconds());

myHours = myDate.getHours();
myMinutes = myDate.getMinutes();
mySeconds = myDate.getSeconds();


if (mySeconds<10) {
theSZero = 0;
} else {
theSZero = ""; }

if (myMinutes<10) {
theMZero = 0;
} else {
theMZero = ""; }

if (myHours > 12) {
myHours = myHours - 12;
}

if (myHours == 0) {
myHours = 12;
}


dateTextField = (myHours+" : "+theMZero+myMinutes+" : "+theSZero+mySeconds);

View Replies !    View Related
Retrieving Asp.net Variables From Flash
hi there.
I have an asp.net page and a flash page and I'm trying to integrate them. The asp.net page simply creates a string variable and I want to access it from flash as3. I'm using the urlloader class and I've tested the flash file using a simple text file and it works fine. The flash file simply displays the variable in a text box.

When I try to run it with a .net file I get the following message -

TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at urlload/::completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader:nComplete()

This is the flash code that fires when the urlrequest has been done.

private function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var vars:URLVariables = new URLVariables(loader.data);
txtVars.text = vars.wardNumbers;
}

...where the asp.net variable is called wardNumbers.

I just don't get it! Any help would be greatly appreciated.

View Replies !    View Related
Retrieving Variables From SWFObject
Hi Guys,

I'm pretty sure I'm missing something really basic here. I'm using SWFObject 1.5 and I want to retrieve both the variables that I'm passing in. Obviously the script I've written here only gets the last one in the loop. How do I assign them to their respective variables?


ActionScript Code:
var _soName:String;
var _xmlurl:String;

var flashVars:Object = this.loaderInfo.parameters;

/*
SWFObject variables passed in like this:
so.addVariable("xmlurl","some_string");
so.addVariable("soName","some_other_string");
*/

for(var i:String in flashVars) {
    _soName = flashVars[i];
    _xmlurl = flashVars[i];
}
txt.appendText("soName = " + _soName + "
xmlurl = " + _xmlurl);

This just gives me the same variable twice.

Thanks in advance.

View Replies !    View Related
Storing Internal Variables
I need to create a fairly simple trivia game which is completely self contained. All the questions and answers need to be stored within the Flash movie as lists of variables. What is the best way to do this?

View Replies !    View Related
Storing Variables Into An Empty MC
Hi everyone.How can I store all variables in my movie from different MC's into one MC so they can all be easily accessable? Thanks in advance!

View Replies !    View Related
Storing Values In Variables?
Wondering how I can I store variable information so that when a movie is relaunched it can retrieve that data...

a thanks ahead for you help

View Replies !    View Related
Help With Storing And Restoring Variables
OK I have an .swf that loads variables from a text file. Is there any way to control size and color this way? If not, is there a way where you can upload a variable in custom color or size to a flash movie and is that way easily updatable?

View Replies !    View Related
Storing Dynamic Variables
hi guys...i have a dilema... i am making a site for a reunion. i was thinking of a map (an mc) and the different users could put a "pushpin" into the map. This would mean for each pin i would have to mark it's location (_x & _y) and store that variable on the server so when others visit(or re-visit) they can see everyones' posted pin. Storing this as a local object will not suffice f....So, what is the best way to store these locations. XML(php writing to the file)? database? Or is there another option?

View Replies !    View Related
Storing Data In Variables - Best Way?
I'm hoping a few of you expert AS'rs can tell me the best way to store temporary data within a flash movie without relying upon XML or a database. I've created a movie that calculates specific data for a company then generates a graph. I have probably 50 variables that store numbers and then eventually calculate at the end. I've been keeping them on the _root timeline and was wondering if there is a better way to store them?... maybe a more optimized procedure? Thanks in advance

View Replies !    View Related
Storing Variables Loaded From .TXT
I'm having trouble manipulating variables loaded from a .txt file once they are in flash.

My .txt file is simple and looks like this:
Code:

&num=3



Within flash I then try to load the text file setting the variable 'num' in flash to "3". This part works because when I debug it prints:

Variable _level0.num = "3"

I then try to concatinate "3" with ".jpg" to load a jpeg into the timeline. The code looks like this:
Code:

var num;
loadVariablesNum("data.txt", 0);
loadMovie(num add ".jpg", "_root.12");



It seems that I'm missing somthing on how to manipulate the 'num' variable, becuase I can use it in a dynamic text field, just not as a variable anywhere else. I can manually put in the jpeg's path and it works fine, but not when I try to use the above method. Any help would be appreciated, thanks.

View Replies !    View Related
AttachMovie And Retrieving Variables Within MovieClip
Hi All,

I'm having a slight problem I'm hoping someone has the answer to.

In one frame I'm attaching a MovieClip to the stage:
_root.attachMovie("Button0004", "newbutton",525);
trace("textfieldx is equal to "+_root.newbutton.textfieldx);


The trace doesn't return a value for _root.newbutton.textfieldx

But when I put the trace on a button and press it afterwards, it returns the correct value.

textfieldx is defined within the MovieClip "Button0004". I would think I would be able to access the value textfieldx as soon as I attach the movie.

Any thoughts on why it's not working directly after the movie is attached?

Thanks much.

View Replies !    View Related
Retrieving Variables In Dynamic Text
I have this button/image which changes the dynamic.text variable and takes me to a new scene.

this.onImagePress = function(the_ibox){
_root.dynamic.text="Stuff";
_root.gotoAndPlay("new scene");
}

This takes me to my new scene and changes the dynamic variable to = "stuff" but I don't know how retrieve the data in the dynamic text so I get this code to retrieve dynamic.text data.

img1.loadImage(dynamic.text+"/"+dynamic.text+" ("+(1)+")"+".jpg");
img2.loadImage(dynamic.text+"/"+dynamic.text+" ("+(2)+")"+".jpg");
img3.loadImage(dymamic.text+"/"+dynamic.text+" ("+(3)+")"+".jpg");

A simple question but obviously my know-how has a few gaps.

Thanks

View Replies !    View Related
[AS3] Retrieving Variables URLLoader.data
hey, im back with another as3 question

i've been setting up a high score table in my game, and everything is working, but i cant work out how to get variables from the URLLoader.data that im retrieving

if i trace loadedScores.data, i get this
&name1=matt&score1=323250&name2=1234567890123456.. . and so on

i've tried passing it to a URLVariables constructor, but it says the string doesnt contain the correct name/variable pairs or something, and loadedScores.data.name1 doesnt work...

thanks for your help, cant work this one out for the life of me
cheers

View Replies !    View Related
ERROR Retrieving Flash URL Variables
Hello, I am working on a flash movie for a client and I have not used flash much before at all.
Reading many tutorials online I have come up with the following two files.

I have the object/embed code here below with the following src path sos.swf?wID=5.
I need that wID so when I load certain variables from a php page later on in the movie I can access that persons information (wID correspons to the primary table key).


HTML Code:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="383" HEIGHT="180" id="myMovieName"><PARAM NAME=movie VALUE="sos.swf?wID=5"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="sos.swf?wID=5" quality=high bgcolor=#FFFFFF WIDTH="383" HEIGHT="180"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
I then have the following actionscript in my flash movie


Code:
var widgetID = _root.wID;

/* first create a new instance of the LoadVars object */
myVars = new LoadVars();
// call the load method to load my php page
trace(widgetID);
myVars.load("sos.php?wID=" + widgetID);
// once vars have been loaded, we will have these variables:

var var_firstname = myVars.firstname; // "pietro"
var var_years = myVars.years; // "lana"
var var_months = myVars.months; // "pietro@flash-php.it"
var var_days = myVars.days;
var var_minutes = myVars.minutes;

days.text = var_days;
years.text = var_years;
firstname.text = var_firstname;
months.text = var_months;
minutes.text = var_minutes;
I have tried several things and I am not sure just how to access the flash URL variables. To make sure I am putting the action script in the right place I have only one layer, and when I click on that, I enter the actionscript in the actionscript window for that layer. Is that the correct place to put it? I am pretty sure it is but I just want to double check.

The variables.text at the bottom are my dynamic text boxes that are displaying information from the sos.php file.

Nothing is showing up in my movie and I am unaware of good debugging techniques for actionscript. I have tried to trace(widgetID); but nothing shows up in my movie. I am not sure if that is because of the image I have on the screen or what.

Any help to get the URL variable into my movie and then to correctly pass it to my php file would be most helpful. I have hit a brick wall at this point.

By the way here is the part in my php script that sends the variables over. They do have data in them but nothing is being displayed in the dynamic text boxes.


PHP Code:



$vars = "&firstname=".$name."&years=".$totalYears."&months=".$totalMonths."&days=".$totalDays."&minutes=".$totalMinutes."&meals=".$var_meals."&meetings=".$var_meetings."&movies=".$var_movies;echo $vars; 




Thanks again for anyone who can try to help me out.
I really appreciate it.

View Replies !    View Related
Storing Variables In A Flash Movie
To store a variable in Flash 4, is it a necessity to put it into a text field??

Will the movie just store the value *there* in the movie, rather than me having to create god knows how many text fields to hold them?

If that doesn't make sense, think of it as ASP or PHP scripting or something. You can have variables flying about but they aren't actually STORED anywhere - they just exist as abstract objects. Does Flash do this, or do I need a text field?

Ta,

Nick

View Replies !    View Related
Question About Variables - Not Storing Values?
I'm having a trouble with variables that really makes *no* sense to me whatsoever. It goes against everything I've learned in any coding language. Why is it that flash seems to arbitrarily decide when it will and won't store a value into a variable? I know that that's obviously not the case, but I've been tracing a variable to figure out why my if statement is never executing.

I have a movie clip that I've created with code using the attachmovie function. The object is named "sprite" afterwards.

I've created a sprite.onLoad = function(), and in that, several variables are declared, including the one I'm testing, canMove. Then, in the sprite.onEnterFrame = function() event, I have it tracing canMove. canMove is set to true in the onLoad function, but when I trace it, I get 'undefined'.

I tried to declare canMove in the onEnterFrame function, for testing purposes. I declared it the line ABOVE the trace, and I still continuosly got 'undefined'.

I changed the code from
code: var canMove:Boolean = true;
to
code: var canMove:Number = 1;
and I continued to get undefine. Finally, I just said,
code: this.canMove = 1
and I got a result.

So, I moved the code back to the onLoad event, and again started getting undefined.

What is the difference between all these declarations? Why does this.canMove = 1 and not var canMove:Number = 1 work? This is really frusturating me, as this is supposed to be a really simple line of code, yet it's stopping me cold in my tracks.

View Replies !    View Related
Storing Variables Outside Of Xml Parsing Function
hi guys

I'm parsing xml data in flash, here is some example code:

var file:XML = new XML();
file.ignoreWhite = true;
file.load("test.xml");
file.onLoad = function(bSuccess:Boolean) {
if (bSuccess) {
var banana:String = this.childNodes[0].childNodes[0].childNodes;
}
}

if i do a trace(banana) from inside the function, the text is displayed,

however if i do a trace(banana) command outside of the xml function the result is undefined.
How can i store information into variables that are then accessible outside of the xml parsing function?

I'm guessing i'm getting confused over variable scope or something, thanks for all your responses, they're really helpful.

View Replies !    View Related
Storing Variables For Entire Movie
Hi.
I'm making a basic flash movie and am working with characters and backgrounds that are all within movieclips. Now I'm just wondering if there's a way to keep a frame in a child movieclip when it's no longer playing the movieclip. I dunno if this makes sense.

Example:
This is a movieclip called character where there are buttons to select characters.

on (rollOver) {
head.gotoAndStop("eva");
Rhand.gotoAndStop("eva");
Rarm.gotoAndStop("eva");
Lhand.gotoAndStop("eva");
Larm.gotoAndStop("eva");
Lhip.gotoAndStop("eva");
Rhip.gotoAndStop("eva");
top.gotoAndStop("eva");
Lleg.gotoAndStop("eva");
Rleg.gotoAndStop("eva");
names.gotoAndStop(5)
}
on (release) {
_parent.gotoAndStop(6)
}

On rollover all the body parts change to the specific character. The problem is once it goes outside of the movieclip, it goes back to the firstframe. I know there might be a way of declaring it as a variable but I can't seem to get it. Anyone know?

I dunno if I've explained this properly. If u don't understand, pls ask.

View Replies !    View Related
Quick Code For Storing Variables
I need a quick script that can allow me to store data in an external file (such as a .txt file) then load it up the next time I run the movie. These events both happen after a button press.
Any help is appreciated.

View Replies !    View Related
Storing Logical Operators In Variables
hey there,

Instead of writing out a conditio twice is it possible to pass the logical operators || or && through a variable?


Code:
a= true;
b = true;
c = operator || or &&

if (a c b) {
//
}
Is this even possible?

thanks,
ward

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved