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




Using Variables In Flash



hello
having a little trouble understanding variables in flash...
when trying to use variabled to determine the path to an image that is loaded on screen...

Example:

var site = "meta-phor";
var pictype = "carimages";
loadMovie("http://www."site".com/"pix"/loadz/image1prev.jpg", "preview1", "GET");
loadMovie("http://www."site".com/"pix"/loadz/image2prev.jpg", "preview2", "GET");

ect.

does anyone see the problem here?



FlashKit > Flash Help > Flash Newbies
Posted on: 12-28-2005, 11:31 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Return Variables From Php To Load In Flash Text Variables
Im having an issue using the kirupa flash login. I already have the actual login working with php and mysql but i need to change it up a little bit and i don't know enough about php to write it myself. But here's the situation.

Flash login is a basic script, I've already modified this part and it works great

What I need to know is how to modify it so when a user logs in, php captures the $_POST and returns the alternate variable fields that consist of ("co","fname","lname","cph","email") within the ID for user and pass

also i have already made a common loadMovie to load random variables i just need the php to point to the movie

Get Variables Inside Flash 9 Movie With Action Script 3 Using Flash Selenium And Sele
Dear All,


I use Selenium RC and I want to do automated flash testing. I am using Flash Selenium.


Web Application has Flash content (SWF file) and is Version 9.0 and uses Action Script 3.0.


I cant use the functions like flashApp.Getvariable(varName) or flashapp.TotalFrames() as mentioned http://code.google.com/p/flash-selenium/


I see documentation and functions listed at ( http://www.adobe.com/support/flash/p...h/scriptingwit hflash_03.html functions for Flash 5 ), i cant use them . I get exception all the time.


I am trying to access the varibales in the flash movie which is loaded using GetVariable but Selenium throws an exception but no information message.


I want to ask can I use functions listed on above adobe site with Flash 9 movie with Action Script 3.0 ? If not is there any way to get variables inside Flash movie using Flash External Interface and Selenium RC ?


Best Regards !


/ Yogesh

Send Variables From Flash 5 To Servlet And Get It Back In Flash
Does anyone know how to send variables to servlet in Flash?
I think I should use the loadVariables () to pass all the variables, but I'm not sure how to type in the URL part so that servlet can get them. My swf and servlet file are in different folders ... Must they be put in the same folder? Or I should use some XML formatting in transmitting data between Flash and servlet??? Please give me some help, thx a lot!!!

Saving Flash Variables To A Textfile (not A Flash Cookie)
I am creating a game (.exe) using flash. I have all the necessary tools except that I don't have any idea on how I can save user data without using SharedObjects because the user might want to play on another computer using his saved game so there has to be a way for flash to save variables to a textfile (at least) in a specific location, relative to the location of the projector(.exe).

Or is there any of you who can point out cheap (or better free) alternatives (3rd party tools) for me to do this?

Thanks guys!

Flash Passing Variables To Flash (sort Of)
OVERVIEW
----------------------------------
We will use the values passed in on the url of the html document containing testmovie.swf. The URL = http://www.test.com/testmov.html?id=123&message=hello
. As you can see there are two variables attached to this URL. Variables passed on the end of this URL can be accessed and sent to a swf within this document. This URL with variables can be generated in many ways, including using the geturl method in flash, form posting using get method, hard coded hyperlink, etc.., etc.. . The nice thing about this process is that you do not need to use PHP, ASP , or any other server model. Just straight client side script.


HOW IT WORKS
----------------------------------
The following function parses the window.location (url) property into two arrays. The first contains the names, and the second contains the corresponding values. Then the length of the array is determined so that each array can be iterated through. The setvariable command is used to setvariables inside the testmovie.swf.

Call this function in the documents onLoad event since all of the documents contents will be loaded prior to the function being called.

<head>
<script language="javascript">
function splitstring(){
var a;
var i;
var namevalpairstr;
var firstpair;
var names;
var values;
var WinLoc;

WinLoc = window.location;

a = new String(WinLoc).split("?");
namevalpairstr = a[1].split("&");
l = namevalpairstr.length;

for (i=0; i < l; i++){
nameval = namevalpairstr[i].split("=");
window.document.yourmovienamehere.SetVariable (nameval[0], nameval[1]);
}
}
</script>
</head>
<body onLoad="splitstring();">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="400" height="200" id="testmovie" name="testmovie">
<param name=movie value="testvars.swf">
<param name=quality value=high>
<embed src="testvars.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="400" height="200" id="testmovie" name="testmovie" swLiveConnect="true">
</embed>
</body>

**NOTE**
To get this to work in Netscape it is important to have the swLiveConnect attribute set to true in the embed tag.
[Edited by mattryan on 08-15-2001 at 02:17 PM]

Menu Flash Load Variables To Flash
i made a drop down menu in flash, that is calling data fro mysql.

the menu is like this:

imagine:

+-------------------+
| Company
+-------------------+
| about us
|
|
|
|
+-------------------+

when i pass the mouse on the button company show the sublink about us..

the text about us is in the database. the about us is a dynamic text box that is called like word, and the

getURL(url) is like this.

the code in php that i've made is like this:

[HTML]<?global $Server, $UserName, $db_password, $DBName, $Nome, $lang;
$hConn = OpenConnection($Server, $UserName, $db_password);
$menu = new clsRecordset;

$sql="Select * from menus_paginas inner join menus_paginas_linguas on menus_paginas_linguas.ID_PAI = menus_paginas.ID where menus_paginas.ID_PAI= 4 and Lang='$lang' ORDER BY menus_paginas.Ordem";
$hRes= $menu->Open( $hConn, $DBName, $sql);
if($hRes)
{
while(!$menu->EOF())
{
?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="780" height="228" valign=top>
<param name="allowScriptAccess" value="sameDomain">
<? ?>
<param name="movie" value="templates/uniscala2.swf?empresa=<?php echo $menu->aFields["Nome"];?>&url=<? echo $menu->aFields["Pagina"];?>">
<param name="wmode" value="transparent">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<embed src="<?php echo "templates/uniscala2.swf?empresa=".$menu->aFields["Nome"]."&url=".$menu->aFields["Pagina"];?>" quality="high" wmode="transparent" bgcolor="#ffffff" width="780" height="228" valign=top allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
<?


$menu->next();

}
}
?>[/HTML]
if you see the code is calling the values, if i go to the database and add a new field it should appear like this:

+-------------------+
| Company
+-------------------+
| about us
| new field
|
|
|
+-------------------+

but if you see in the code, the menu will repeat him self to appear the new field;

like this:
+-------------------+
| Company
+-------------------+
| about us
|
|
|
|
+-------------------+

+-------------------+
| Company
+-------------------+
| new field
|
|
|
|
+-------------------+

what i wish is that you explain to me, a way that when every time i add a new field in the data, the flash creat a new button, calling the new field instead of repeating him self.

help me please.....thanks.

How To See The Flash Variables Inside A Flash Which Is On A Web Page?
Hello,

How can I see the flash variables on a flash movie which is embedded on a web page? Is there a program or? I am making an animation which uses php so I need to see the variable to debug

Thankx,

Sending Variables From Flash To Php And Back To Flash
I am trying to send two String variables to php and from php back to Flash where i am trying to display them in TextField. The problem is that i keep geting this error:


Code:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.


Here is my AS3 code:


Code:
var request:URLRequest = new URLRequest ("http://localhost/addUser.php");
request.method = URLRequestMethod.POST;

var variables:URLVariables = new URLVariables();

variables.firstName = "FirstName";
variables.lastName = "LastName";
request.data = variables;

var loader:URLLoader = new URLLoader (request);
loader.addEventListener(Event.COMPLETE, onComplete);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);


public function onComplete (event:Event):void{
statusTxt1.text = event.target.data;
}


And my addUser.php code:


PHP Code:




<?php

$fname = $_POST['firstName'];
$lname = $_POST['lastName'];

echo $fname;

?>







Can someone please help me on this?

thanks in advance,
cheers

Sending Variables From Flash To Php And Back To Flash
I am trying to send two String variables to php and from php back to Flash where i am trying to display them in TextField. The problem is that i keep geting this error:


Code:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
Here is my AS3 code:


Code:
var request:URLRequest = new URLRequest ("http://localhost/addUser.php");
request.method = URLRequestMethod.POST;

var variables:URLVariables = new URLVariables();

variables.firstName = "FirstName";
variables.lastName = "LastName";
request.data = variables;

var loader:URLLoader = new URLLoader (request);
loader.addEventListener(Event.COMPLETE, onComplete);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);


public function onComplete (event:Event):void{
statusTxt1.text = event.target.data;

}
And my addUser.php code:


PHP Code:



<?php$fname = $_POST['firstName'];$lname = $_POST['lastName'];echo $fname;?>




Can someone please help me on this?

thanks in advance,
cheers

Sending Variables From Flash To Php And Back To Flash
I am trying to send two String variables to php and from php back to Flash where i am trying to display them in TextField. The problem is that i keep geting this error:


Code:
Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
Here is my AS3 code:


Code:
var request:URLRequest = new URLRequest ("http://localhost/addUser.php");
request.method = URLRequestMethod.POST;

var variables:URLVariables = new URLVariables();

variables.firstName = "FirstName";
variables.lastName = "LastName";
request.data = variables;

var loader:URLLoader = new URLLoader (request);
loader.addEventListener(Event.COMPLETE, onComplete);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(request);


public function onComplete (event:Event):void{
statusTxt1.text = event.target.data;
}
And my addUser.php code:


PHP Code:



<?php$fname = $_POST['firstName'];$lname = $_POST['lastName'];echo $fname;?>




Can someone please help me on this?

thanks in advance,
cheers

Passing Php Variables To Flash? Flash Php Mp3 Player?
Passing php variables to flash?

I want to pass variables from php to flash.

The point is to create a simple mp3 player that plays the file listed in the php variable.

Simple start and stop player 2 buttons.

I just don't know how to do it as i have very little flash experience.

Using Flash 8 Pro.

Doesn anyone have working code for this?

EXTREMELY URGENT - Creating Global Variables Using Names Of Other Variables...
I have variables xtile and y tile within a movie, and I need to create a global variable that will tell all other movies that this particular movie is situated on tile [xtile][ytile], so I need to know how to create the global variable: _root.objectmovie_xpos_xtile_ypos_ytile = true;

I know how to create global variables, and how to have other movies read them, but how do I actually create a VARIABLE with this name? I tried set ("_root.objectmovie_xpos_" + xtile + "_ypos_" + ytile") = true, but that doesn't work (which I kinda knew already but thought I would give it a shot)
any ideas peeps?
please help, its vital to a project I am doing

cheers all

My Variables Load With LoadVars...how Do I Execute A Loop To Assign Variables?
I have 52 (one for each week) duplicated MCs, a loadVars(), and variables "sermonTitle" and "airDate," which I'm trying to assign with the following:

this.airDate=_root.loadContent["airDate" + sermonDate];
this.sermonTitle=_root.loadContent["sermonTitle" + sermonDate];

which is placed in an onClipEvent (enterFrame) handler of the button which is duped . The vars load when I click Video > 2001.

The vars loaded have values named sermonTitle1, sermonTitle2, etc. and the same for airDate. The numbers attached reference the sermonDate which has already been assigned though my duplicateMovieclip loop:

num = 52;
ystart = b._y
n = 1;
while (n <= num) {
duplicateMovieClip("b", "b" + n, n);
setProperty("b" + n, _y, ystart + n*17);
this["b"+n].sermonDate = n ;
trace(this["b"+n].sermonDate);
n = n + 1;
}

I've tried attaching the assign code to the dupMovieClip loop:

num = 52;
ystart = b._y
n = 1;
while (n <= num) {
duplicateMovieClip("b", "b" + n, n);
setProperty("b" + n, _y, ystart + n*17);
this["b"+n].sermonDate = n ;
this["b"+n].airDate = "airDate" + n;
this["b"+n].sermonTitle = "sermonTitle" + n;
trace(this["b"+n].sermonDate);
n = n + 1;
}
setProperty("b", _visible, 0);

and it works - as far as assigning the correct value to the correct button, but it does not associate the loaded vars with them.

The SWF is VERY sluggish, though, which makes me think the onclipEvent is not the best way of assigning vars. I get the trace(this) showing all of the variables loading, so I know that's not the problem.


Does anyone know how to best assign these? I have been advised to use a loop for it. How would I go about executing a loop for this, as I will have navs loading in different text files - Thanks

Link to SWF:
HERE

Virtual Student Yrbook: Variables>Arrays>Variables? SOMEBODY RESCUE ME
Hello, All.

I am totally stumped. I am creating a student virtual yearbook, which displays students names with pictures. I cant find a totally understandable tutorial that teaches me how to extract variables from an array. So I created an asp file that writes out all of the student records to different variable names, and load them using loadvariablesnum(). Using this ASP file works, but once I click the exit button to take me back to the front page, it is as if all of my other variables are erased.

I dont completely understand levels when it comes to loading variables, so everything is loaded like this

loadVariablesNum("http://10.0.1.2/tp/tpod/processGet_studentInfo.asp", 0, "GET"); --- "POST" gives me the same results...

To view the pictures you would click a button on SCENE 4, and it takes you to "VIEW STUDENTS PICTURES" - SCENE 11. 'EXIT' sends you back up to Scene 4, which runs an ASP file which simply grabs a message that is updated every 30 minutes. What Level would I use here??? I have tried many.

Everything works beautifully until I exit the VIEW STUDENTS PICTURES page from Scene11

I've written a pretty sizeable file that uses lots of variables.

I am pretty sure that the problem is with the ASP file: "processGet_studentInfo.asp" - because when I comment it out, the application works fine.

::::::::::::SUPPORTING INFO BELOW:::::::::::::::

Here are the variables that "processGet_studentInfo.asp" creates:
&varStudent1=Crystal&varImagePath1=http%3A%2F%2F10 %2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCrystal%2Ej pg&varStudent2=Brandy&varImagePath2=http%3A%2F%2F1 0%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FBrandy%2Ej pg&varStudent3=Angel&varImagePath3=http%3A%2F%2F10 %2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FAngel%2Ejpg &varStudent4=Cathy&varImagePath4=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCathy%2Ejpg&v arStudent5=Destiny&varImagePath5=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FDestiny%2Ejpg &varStudent6=Amber&varImagePath6=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FAmber%2Ejpg&v arStudent7=lester&varImagePath7=http%3A%2F%2F10%2E 0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Flester%2Ejpg&v arStudent8=paul&varImagePath8=http%3A%2F%2F10%2E0% 2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fpaul%2Ejpg&varSt udent9=Ginger&varImagePath9=http%3A%2F%2F10%2E0%2E 1%2E2%2Ftp%2Ftschool%2Fimages%2FGinger%2Ejpg&varSt udent10=Brittany&varImagePath10=http%3A%2F%2F10%2E 0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FBrittany%2Ejpg &varStudent11=chad&varImagePath11=http%3A%2F%2F10% 2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fchad%2Ejpg&v arStudent12=jaden&varImagePath12=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fjaden%2Ejpg&v arStudent13=Jami+Lynn&varImagePath13=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FJami+Lynn %2Ejpg&varStudent14=kara&varImagePath14=http%3A%2F %2F10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fkara%2 Ejpg&varStudent15=Cody&varImagePath15=http%3A%2F%2 F10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCody%2Ej pg&varStudent16=darla&varImagePath16=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fdarla%2Ej pg&varStudent17=Jenna&varImagePath17=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FJenna%2Ej pg&varStudentCount=17&varENDER=1

-----------------------------------------------------------

Here is the meat & potatoes of the ASP file that created this:
oRS.Open "SELECT * FROM STUDENTS", oConn, 2, 3

' Move to the first record
oRS.MoveFirst

'Loop to output all the query results to the document
do while not oRS.eof

' counter to give each record a sequential listing
counter=counter+1

Response.Write "&varstudentname" & counter & "=" & Server.URLEncode(oRS("studentname"))& "&varImagePath"& counter & "=" & Server.URLEncode(oRS("ImagePath"))

' move to the next record
oRS.movenext
loop

'LET FLASH KNOW THAT WE ARE DONE RETRIEVING
Response.Write "&varStudentCount=" & counter
Response.Write "&varENDER=finished"
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::

Please help.

Variables In Flash?
How can i put variables in flash? If i have an object can i use a variable to that object. Can i call this variable with a ASp or cgi prog.?

30 Variables Over URL To Flash. Possible ?
i've encountered the following problem:

my flash film works fine.
but when i increase the number of variables to about 20-30
i get endlessloops when the movie tries to recieve the variables (i have to convert the single variables from JS back to arrays). i've made a preloader : shouldn't that help ??

btw. if so could tell me how to get whole arrays from JS to AS without cutting them to single vars this problem would be solved too.


very thankfull waiting for help

monthu

Variables From URL Into Flash.
I'm not sure if this can be done, but here it goes. I'm a fairly advanced computer user, but i'm going to put this in the easiest, most lame terms I can think of since I can't seem to find the words to explain it.

In a URL like this;

http://www.domain.com/store.cgi?cart_id=352352352

Is there are way for Flash to pull that cart_id variable off the URL and place the 352352352 into the flash movie?

Thanks in advance.

Put Variables From Flash
I have done a game.
I have done an highscore.
I can load a variable into the movie from a text file to show the best score but if someone does an higher score, I can't replace the old one.

Flash For... With Variables.
I think you mean If _root.box.slot([i] > 0 not
If _root.box.slot(i) > 0. When calling for a specific array value, you use [ ].

B

Get Variables From Php To Flash
I have a small problem working with php to flash

this.loadVariables("getdata.php","POST");

what exactly is this statment doing? i need 3 arrays in php to get inputed to flash and i found a little pice of code but it isent working to well.

if some won has any ideas i would be thankful,

Thanx

Variables From Asp To Flash
Hi
i need to send a variable from asp to flash without refreshing the page, is it possable. I don't mind if i need to use javascript.

Can anyone help please?

Many Thanks

How To Get Variables From The Url To The Flash
i need to load a variable in the flash that is on the url of the page that has the flash inside

imagine this url: http://www.website.com/popup_flash.asp?id=12345

that page shows a flash swf, and what i need is to get the id value on the flash swf.


i know that there is a easy way to do this

Anyone can help me please
It's for Flash 5

Thanks

Variables In Flash MX
I've recently learned how to read variables from a text file and i've run into a wall. I've got 4 dynamic text fields that load 4 different variables. My main frame has a series of if statements, so that if 1 of these fields is one of 3 options, go to 1 of 3 frames.

Where's the catch you ask?

Well this particular variable is called difference. My if statements are based on if(difference == 0){gotoAndStop(1);} etc... Unfortunately these if statements can't communicate with the values that are loaded from my text file. It seems that when i loadVariables from the text file it passes them directly to the dynamic text fields and then throws them away.

Thus making my if statements worthless.

Anyone have an idea on how to accomplish acquiring the values of my newly valued dynamic text fields? i.e. after loading the values to the dynamic text field "myDifference" get the equivalent of "value(myDifference)"

Any help would... well, help!

Anyone with the same issue, good luck to ya.

ASP & Variables To Flash
Background:
I am trying to build an intranet site on an NT system in which certain users would not have access to certain areas of the site (managers vs normal people) and the navigation will be in Flash. I would like Flash to know who is who and display the proper movie clip parts or not display them, as the case may be.

The page would be in 3 frames (per request) with a top, nav on the left, and main area on the right.

With NT and ASP, I can detect the user or user group. I am doing this in the frameset and the passing the variable 'user' in a query to the navigation frame, like this: response.write "<frame src='navtest.asp?user=member' name='leftFrame' scrolling='NO' noresize>"

In the frame, I recreated the query string as a variable and have that response there.

In the flash movie, I currently just have a dynamic text field that I want to display the user, but it isn't working. It displays level01.user
I have the Load Variables command pulling my nav page's variables (I think) and targeted to that dynamic text clip.

It isn't working. Is it my method and set up? Do you need more info to help? Thanks

Mike

Variables In Flash
Howdy...

Mmkay. I have different scenes in my flash movie. Halfway through the first scene, there is a menu. The user clicks an option. I then want the rest of that scene to be played, then for it to automatically move to the scene associated with the option chosen. I guess this would be done with variables, so I have this on the on Release function of the menu button:


Quote:




on (release) {
myscene = "kitchen";
}




I then have this on the last frame of the scene:


Quote:




if (myscene="kitchen") {
gotoAndPlay("Scene 2", 1);
}




I have tried declaring var myscene in the first frame of the movie, but that makes no difference.

Btw, i'm an actionscript n00b, so go easy on me please

Thanks

Asp Variables In Flash(mx)
I've been trying to 'read' variables from an Asp file to Flash. So far I've been able to put variables from asp to a dynamic textbox in flash. However, I want to use these variables for some calculations and I cannot find out how this works.
I'm using the following code:
________________________________________
FLASH(1 frame):
loadVariables("test.asp", "", "POST");
if (x == 10) {
_root.textbox = "ok";
} else {
_root.textbox = "false";
}

ASP(test.asp):
<%
response.Write "x=10"
%>
________________________________________

As you understand my output is "false" all the time!!
Can anyone tell me what I'm doing wrong here?

Regards,
Paul

Variables Into Flash
OK, I've done this before without a problem... I call up a database (I use PHP scripting for that) and get the data I need... then I send it to the flash movie. I do that by calling up the flash file like so: flashfile.swf?variable1=variable1&variable2=variab le2 and so on.
These variables are only good to be used in a single scene... I have my preloading screen, then I display some of the data and wait for the user to click GO to place the rest of the scenes, which manipulate some of the data. The first display screen works fine, but after that all of the variables and their data is gone.
I also have a difficult time loading the swf file into the embedded page on my site, but yet if i call up the file name (mydomain.com/file.swf?bla bla) then it works fine...
sample can be found here: http://game.equination.net/race_viewer.php?rid=160451
i can have the fla available if need be
any help is greatly greatly appreciated!

Variables In Flash
Hi,
May be you can help me,
In a sequence, I have a movie clip which contains several variables (the movie clip has is own occurence/name).
How can I achieve the value of these variables when I am in an other sequence ?

Many Thanks, for your help !
Regards.

Variables In Flash
I am a newbie to flash.

Is there any way that i can send the PHPSESSID(sessions) from php to flash and store that variable as a global variable such that all scenes and frame can access.

Php Variables Into Flash
I have made a flash header section for a site that has individual animations for each page on the site. i want to be able to call $pagename, a php variable that sets the title of each page, into flash to trigger the gotoandplay function. I want to do this without appending the name value pair to the url as this could prove problematic given that various other variables are passed across depending on specific circumstances.

Would appreciate any ideas.

Thanks.

GET Variables In FLASH
Hi there

i have this code

on (release) {
getUrl("Untitled-1.swf?framenumber=15");
}

how can i read the framenumber variable in Untitled-1.swf movie??


thanks
Tom

Php Variables Into Flash
How do you take the code below and pass the values back into flash into the respective dynmic text boxes?
VIN works by itself but not when Vehicle year is added


PHP Code:



// If the number of rows is 0--> no hits on query
   if ($numR>0) {  
       for($i=0; $i < $numR; $i++) {
           $row = mysql_fetch_array($result);
       }
       //this works do not alter
       $reply_first = $row['VIN'];
//I want to pass these variables into Flash into respective dynamic text fields
       //$reply_first ="&VIN".$i."=".$row['VIN']."&VehicleYear".$i."=".$row['Vehicle_Year'];
              $values = 'reply_first=' . $reply_first;
       echo $values;          
   }
   else {
   print "not connected ";
   }

Variables From Asp.net To Flash
Hi there
Can anyone tell me how I can send variables from asp.net (c#) into Flash and then again to a new asp.net page?

I am going to add data to a db from flash, and need to pick up the user-name from the asp.net page in which the flash-movie is placed.

Hope someone can help me
Thanx

How Can We The Get Variables In Flash?
Hi!



i have a flash file, i want to get the variables from using this


<object .......... file.swf?id=1>



i want to get the value of id in flash... or anyother method


please suggest me...

please reply me, don't do like you did with my previous post, nobody replied....


Thanks,
Erphan B Rajput.

Variables In Flash
hi,
I have a swf that loads a movie.
The movie that beend loaded have global variables that being used with an asp code.
My problem is that when i put it inside of a movie the global var are not global any more.
Can i put in the loader movie variables that can be controlled from that movie that been loaded inside of it ?

Flash Mx Variables
In flash mx pro 2004, how do I change variables?
Ive got a textbox with the variable name 'talk', and in the frame actions ive put

text = 10;

and it doesnt change the text.
and yes, they are on the same timeline.
This is what id do on Flash 5, but on mx it doesnt work, please help!

Flash Variables
Im working on a project which requires users input in order for the content to be customised. Similar to this site http://www.randomhouse.com/bantamdel...ur/index2.html how they use the users name throughout the site.

I have a main screen that asks a number of questions, which these answers will be called upon in other frames.

Here is the code i have in the main menu


Code:
{
var theObject:String = _root.object_txt.text;
}


In the main page my input text box is named object_txt

so then when the user clicks the enter i want them to goto another frame where what they entered be displayed.

Here is what i have on that frame in another text box but this time named content_txt


Code:
{
_root.content_txt.text = "I have allways wanted to own a " + theObject + " and now i finally will";
}


But when i test it instead of it displaying my text it reads "undefined" where the test should be in the sentence.

Am i not calling it right or?? Does anyone know how i can fix this problem?

I have attached a fla file that shows what im trying to do

Thanks in advanced

Variables From Flash To .txt To Php?
I'm trying to pass variables from php to a text file and have it display in a swf.
ultimately the first_name var will come from a database.

my actionscript is as follows:


Code:
loadText = new LoadVars();
loadText.load("firstname.txt", 0,"GET");
loadText.onLoad = function() {
loadedText.text = this.first_name;
loadedText.html = true
scroller.htmlText = this.first_name;
};
my text file:

Code:
first_name=<?echo " id:$_GET[first_name]";?>
my html code:

Code:
<param name=FlashVars value="first_name=john"/>
<embed src="main.swf" FlashVars="first_name=john"/>
when i test my movie it should say "John" in my text field. Am I missing a php file? can the .txt file get a variable from a php file or from a swf?

I hope this makes sense.

Thanks for your time.

Variables (Flash 5)
Hi all, first post


OK, im working on Flash 5 right now, im pretty good at it, but ive gotten stuck.

I have three main script parts:

1.
A list with some names and the name's own ID
dude1 = "{75FA3}";
dude2 = "{21D9C}";
dude3 = "{F6EBF}";

2.
A text box which a user writes a name (the name written has its own id as above)
example dude2
this box is called nameinput


3.
button which should connect the two.
and i want a way so that if i type dude one, then the code for dude one is set in a variable under any name.

Basicly like fetch variable called (the name typed) and set that code in a variable


it may sound easy but i cant really find a way.

I dont mind using the if command, but i dont want to do:

if name=dude1 (
fetch code for dude1
)
if name=dude2 (
fetch code for dude2
)

because theres gonna be more then fetch code and theres gonna be about 40 of em. but i could use the if, if theres one or 2 using variables......

please help

(flash 5)

Variables In Flash 8
I know I can send variables from an html page using flashvars (http://www.macromedia.com/cfusion/kn...m?id=tn_16417), but i don't know how to make flash do different things depending of what it receives, i want to play a certain keyframe of a movieclip if the variable is, for example, test1 and another keyframe if it is test2.

Can anyone help me?

Thanks a lot

Variables From PHP To Flash
I'm having trouble getting the variables that I am passing from PHP to Flash, to update.

My PHP takes a look at a cookie, then assigns a value to a separate variable. This separate variable (myVar), gets passed into Flash with loadVars and is URLEncoded. If I have deleted the cookies from my PC, the data that gets passed to the Flash clip is correct, but if that cookie's value is changed, then I run the Flash again, it still contains the old value. It doesn't matter how many times you run it, the value still remains the same as the first run after the deletion of the cookies. When you run the php file to see what data is being sent, that information updates perfectly. I am using the onLoad handler, and everything else appears to be correct. Below is the code. Any help would be great.

addressVars = new LoadVars();
addressVars.load("http://localhost/getdate.php");
addressVars.onLoad = function() {
message_alert = addressVars.messagealert;
EOF = addressVars.EOF;
trace(message_alert);
trace(EOF);
}

Php Variables In Flash
ok I have the following actionscript that will include an external .php file and get me my variables that I want included into flash. But if i put all my php coding into the .php file say for instance index.php that runs the flash.swf movie then flash does not receive the variables from php. Only if the php is in a completely seperate document. Is there anyway of having the variable passed in the same document?

Basically I have an email sent to a user when they register. This has example: http://www.mysite.com/members/index.php?memid=10456

I want to pass the memid that is posted from their email to my flash file which in return has a form for paypal that will send their memid=10456 as the custom variable to paypal and back. How can I achieve this?

ACTIONSCRIPT CODING:

on (release) {


myData = new LoadVars();

myData.onLoad = function(){

placeTheDataIntoTheRightPlace();

};

myData.load("http://www.mywebsite.com/members/test.php"); // for external file I want same file that loads the .swf to get the memid for the user.

placeTheDataIntoTheRightPlace = function(){

custom.text = myData.customdata1;


//create the LoadVars that will hold our paypal information
var paypal = new LoadVars();

//specify the business, amount of the item, shipping, etc.
paypal.cmd="_xclick";
paypal.business=" ikonpr_1195618222_biz@gmail.com";
paypal.currency_code="USD";
paypal.amount="67.00";
paypal.item_name="The Book";
paypal.no_shipping="1";
paypal["return"]="http://www.mysite.com/purchase/success.php";
paypal.cancel_return=" http://www.mysite.com/purchase/cancel.php";
paypal.custom=myData.customdata1;

//send information to PayPal
paypal.send("https://www.sandbox.paypal.com/cgi-bin/webscr ","POST");

}
}

[F5] Variables Into Flash...
Hey everyone.

got a little issue. i think it's a little more complex as i think it is.

Frame 1:
loadVariables( "stats.txt", "_root" );

Frame 2:
stop();

MC ON STAGE:
onClipEvent (load) {
if (var01 = 0) {
_root.status01.gotoAndStop( "offline" );
} else if (var01 = 1) {
_root.status01.gotoAndStop( "online" );
} else {
_root.status01.gotoAndStop( "nostatus" );
}
}

INSIDE MC:
stop action spans all frames in MC and labels as specified above with green, red and grey as their respective status'.

stats.txt:
&var01=0
&var02=1
&var03=0
&var04=1
&var05=0

doesn't work...
Will be adding a php script to this later for the user to write tothis txt and then swf will update it's status' from the txt's variables.

notes: the script
if (var01 = 0) {
_root.status01.gotoAndStop( "offline" );
} else if (var01 = 1) {
_root.status01.gotoAndStop( "online" );
} else {
_root.status01.gotoAndStop( "nostatus" );
}

if it doubles up on the var01 == 0 it won't work. only works with one = sign.
This constantly shows "online" when the dynamic text as a trouble shoting device clearly shows the variable in the text file. why can't this simple script read those variables?

Thank you for your time.

AS3 - Flash Variables -> PHP
hey there,

I was wondering how I would use Actionscript to send a variable to the PHP page the swf file is on WITHOUT reloading the page...

for example

this will be my php code

Code:

FLASH FILE EMBEDDED HERE

if($password == "hello"){
echo "<div>HIDDENCONTENT</div>";
}else{
echo "please enter password";
}
I want the flash file to push out the variable $password when a button is clicked WITHOUt refreshing the page can this be done?

[F8] PHP - FLASH Variables
Hi all,

I have a log in system that works with the following actionscript & php:

Actionscript


Code:
on (release) {
if (userName.length>0 && userPassword.length>0) {
myVars = new LoadVars();
myVars.username = userName.text;
myVars.pass = userPassword.text;
myVars.action = "login";
myVars.sendAndLoad(php_file, myVars, 'POST');
myVars.onLoad = function() {
if (!this.error && this.user>0) {
_root.gotoAndStop('registered');
} else {
_root.gotoAndStop('no_registered');
}
userName.selectable = true;
userPassword.selectable = true;
loginButton.enabled = true;
};
userName.selectable = false;
userPassword.selectable = false;
loginButton.enabled = false;
}
}

PHP Code:



// ---
// login, check user
// ---

function login($username,$pass)
{
   GLOBAL $db,$table;
   $username = trim($username);
   $pass = md5(trim($pass));
   $query = mysql_query("SELECT * FROM $table WHERE userName = '$username' AND userPassword = '$pass'");
    return mysql_num_rows($query);
}




Also in the database i have a field called userBalance, i know this field is being called because of this line:


PHP Code:



$query = mysql_query("SELECT * FROM $table WHERE userName = '$username' AND userPassword = '$pass'");




What i want to do is output the value of this field and then put it into flash.

Cany anyone offer me any advice?

Thanks in advance

Getting Flash Variables
Hi,

I have hosted flash control for playing flash files (SWF files).

Now I have to enumerate all flash variables ( buttons , hyperlinks etc) present in flash file.
For this I have called GetFlashVars() of control , but returns null.
I am using c++ for playing flash files.

Is there any way to get all flash variables present in flash file.

If I call SetVariable() of control , then it is returned in GetVariable() but not for variables already present in SWF files.

Thanks

Using PHP Variables In Flash
Hey guys,

quick question. I have figured out to get my php variables into my flash file. now i am curious. I have an image that corresponds to php var (item_id).
Now what i want to do is grab that image from the server bring over to flash.

how can i get this to happen when the page loads? i mean there wont be a button or anything to add an Event Listener to.

my second question is if my item_id=12345 how can i write the string for the URL to get the image?

i was thinkin something like

Code:
var BaseUrl = 'http://www.mysite.com/images/' + item_id.text + '.jpg'
would the above work to search for the image in my images folder?

any help is appreciated.

Flash Variables Put Into PHP
I've got a flash contact form pointing to a .php file. The results of the contact form should be emailed to myself, but the email receieved is empty....!

How do I get the flash input text variables to communicated with the php?

Here's my php code:
(There are only 3 fields: Name, Email, and Age)


Code:
<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link

// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['Email']));
$EmailTo = "bigdan03@sbcglobal.net";
$Subject = "Buddha Thursday Test";
$FirstName = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Age = Trim(stripslashes($_POST['Age']));

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "
";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "
";
$Body .= "Age: ";
$Body .= $Age;
$Body .= "
";



// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

?>
Also, here is my actionscript on my Submit button:


Code:
on (release) {
if (Name eq "" or Email eq "" or Age eq "") {
stop();
} else {
loadVariablesNum("thursday.php", 0, "POST");
_root.thursdayguestlist_mc.gotoAndPlay(2);
}
}
Any help is greatly appreciated; thanks.

Flash Variables
Hi There friendly people, I have a quiestion about flash variable. How do I put a variable to a flash button link?

I read a tutorial about displaying a variable in flash, but Im confuse how to make it a link instead of displaying it.

sample link is

onRelease {

geturl ("http://www.website.com/var")

}

where /var should be the variable.


thanks in advance!

Copyright © 2005-08 www.BigResource.com, All rights reserved