ActionScript 2.0 :: Passing Variables To Skip Flash Movie?
Jun 19, 2009
When you click on a link, it takes you (_self) to an "in-between" page that contains another Flash movie (that tells customer to be sure to come back to our page in the future). This Flash movie is coded so that it automatically opens a new window (_blank) to a different site. Then, HERE IS WHERE I HAVE MY PROBLEM, the original page (which is now hidden behind the new window) redirects you (_self) back to the homepage. SOOOO, when your on the new window, you can hear the lady's voice in the background.
NOW, what I want to do is to pass a variable so that, when you get redirected back to the homepage, it skips the lady speaking and goes directly to the looping slideshow.For example, "if F=1, gotoAndPlay(346);"I know that's not proper actionscript, I'm just saying what I have in mind.I've never passed variables before, so the more detailed the better.Note: I am using Flash CS3 and Dreamweaver CS3 (.asp)
just wondering if theres a way to pass variables to a duplicated movie. Ill be creating duplicate movies very fast (about 20 per second) and want them each to have differrent variables to work with.
duplicating with that , and i want to pass 3 variables to the new movie clip
I have a movie clip where I store a value in a variable called "yourname" and then load a different .swf file in level 1. I display the value of "yourname" in a dynamic text box, that works fine. I then move on to a frame where the user has an input text box and can re-enter a value for the "yourname" variable, and then clicks a button symbol to reassign the value. Bear in mind, "yourname" was not originally stored on this level and this movie clip, it is stored on level 0 on the first (main) movie clip. Here is my code in the button:
on (release) { _level0.yourname = String (inpt_newName.text); }
inpt_newName is the input text box. My intent here is to have a "main" timeline where variables are stored, and then load and unload various .swf movie clips as needed, storing and variables (i.e. decisions) that the user makes.
Just need to figure out how to pass root level variable to a movie clip which contains a dynamic text box to display the passed variable. How is this possible? I usually use global variables when i was coding in AS2...but it appears this feature is dropped in AS3.
I can't seem to load a movie clip, and then pass some variables from that loaded movie clip back to through stage_mc it is loading into - to the SubClip.
The structure is as follows:
Main >SubClip >>Stage_mc
Where the new movie clip is loading into stage.
I need to pass two variables from the loaded clip into the SubClip. Simple vars to fill some dynamic text in SubClip.
I've done the whole _root.myvar thing, _parent, and _global.
I am trying to build a Calculator used in health circles to project next year's profit and loss etc. I am using flash cs3 and actionscript2.My flash project is based on accordion component with 6 child panes, each pane having a movie clip with input text, dynamic text etc.I have a couple of push buttons that has click eventhandlers taking care of calculations . All the calculative functions are in the actions layer frame 1.I need help in displaying the same calculated fields as dynamic text in a new movie clip in another layer before printing the same movie clip.The present situation is like this, I am able to calculate all the fields, but when i click a button to show a new movie clip with all the calculated fields, all the variables are displayed as "undefined".
the dynamic variables in the new movieclip is referenced correctly i guess, i use pp_acvcfy = myacc.overheads.acv_cfy; where myacc is the accordion component , overhead the child pane and acv_cfy the dynamic text inside the pane 'overhead'. pp_acvcfy is the dynamic text in the new movie clip. Please help
Creating a flash project where users can visit the site, and turn off/on objects in a house (ie. lights, tv, computer, etc.) The next user who will visit the house in the website, will see what lights or house appliances were left on. Flash variables are passed to PHP, and those variables are saved in an XML file. (For testing to see what is being saved to the XML file, on each click --vars.xml opens.) In the vars.xml file, I see that the house objects that were last turned on--are saved in the XML file- But in the SWF file, only one of the objects that are listed in the XML are turned ON. Only the last object that was clicked on would show ON--not all the objects in the XML file.)
package { import flash.display.MovieClip; import flash.events.MouseEvent; import flash.events.Event; import flash.text.*; import flash.net.*; public class House extends MovieClip { [Code] .....
So, I read the tutorial about passing variables by changing the url of the .swf with the following code:
Code: if (movie==1 or movie=="") { trace("default"); }
[Code]....
My question is, is there anything special if I want it to respond to the url of a .php page? So, if I have a page that ends in "?page_id=2" could I do the same thing or does it have to be an .swf?
Code: if (page_id==1 or page_id=="") { trace("default"); }
I have a problem using a very simple URLVariables script with php.The thing is this sample do works on some servers and doesn't on other:Instead of having the correct values with trace, I get the php code itself.That means I get the following string in trace():[code]I know it comes from the php configuration on my server because I tested it on another server and it works, but I can't find what I must change in my php.ini file to get the good results in trace();
I have a simple standalone application written in Visual Basic that I'm porting to a browser based application using PHP/javascript. The original VB application has some simple embedded flash games with token and point counters. The token and point values are being passed as variables between the application and the game.
I'm trying to achieve the same effect in my PHP port without modifying the actionscript code( using the variables in actionscript that already exist). Below is Visual Basic code that's loading a value from a database and posting that value to flash using FlashVars:
I have an image uploader that runs on a separate PHP script, and then updates the Preview Url after the file has been uploaded. But what I'd like to do is have a Flash SWF embedded in the same HTML that's running the PHP Uploader to get that Preview URL and display it in the Flash Application.
I have a php file that loads 2 variables to a new php page that has flash embedded. This works fine, I can see the variables in a dynamic text box I created, the problem is that I need to take the 2 variables and put them together, then load it in a gotoAndPlay.It then should play at that time-line but it just plays from the beginning frame.[code]
We have a web page which loads a Flash flipbook. This flipbook grabs the content of an external XML file which lists the images to be used for each page. I need to be able to send a word or number into the flash file which is then picked up and used as the name of the XML file. This will allow us to use the same flipbook to display different content depending on different the variable we pass in, without having to have multiple versions of the flash.So, having tried all the different places to add the querystring which I understand you use to pass the variable, I currently have this in the web page (note, "zone" is my variable and I'm trying to set it as 1 here).[code]
In case it helps to see the actual files I've tried to strip them down as much as possible, and put them at URL...Ignore what's going on in the linked flash files.You can see a working one where the XML file name is hard-coded at URL... and a failing one with an attempted passing of the XML filename at URL...The actionscript I'm editing to try get this to work appears under actions: Frame 1 inside 'Premium Page Flip'. Around line 153 in the original is a line saying this.extXML.load("1.xml"). I'm just trying to bring the "1" part in through the querystring.[code]
I am currently trying to pass a single number variable (a score) back to ASP.NET. I have written something that I believe is able to pass the score back but I don't know how to get the value using ASP.NET. Every tutorial I have found has either been using a different version of AS or not in ASP.NET.
How do you pass variables from flash to php?What I wanna do is, get the username and password entered in this form made in flash, when the submit button is hit, it will open and send these variables to login_processor.php. If the info is put in correctly, it will take them to a different page.The login_processor.pgp works for html form, but not for flash. In flash I have two input texts, and I gave them each their own var names.This code I assigned to my submit and reset button:
I'm trying to send variables to flash from php and I can but the problem is that instead of showing the value of the variable, its name is shown instead.
is there any way i can get a variable from a url passed into flash? if a url contains '?go=contact' is there anyway of gettin the value of go passed into a swf?
I have a setup where I am loading 3 XML nodes from a database. It lists 2 of the 3 onscreen - an item and an item price. I am trying to have it work so that when an item is clicked that the item_id (loaded in the xml, but not displayed on screen) jumps to a frame with a dynamic text box and have it list ONLY the item clicked. So far, I made it jump to the frame with the text box and it lists the entire list, not just the item.I really want it so that you click an item then it stores the item_id in the background (then a mc plays saying "item added to cart"). I want the ability to store more than one item_id from different categories and when a user presses the 'view cart' button, that the text box loads those items.
I think I am close, but I got to thinking if it would be better to have some way of doing a php session or something similar to store the item_id and then when the 'view_cart' button is pressed, the text box lists the item_id and the item_name and item_price for each item in the session. I wasn't sure if Flash can talk to php like that. Can it?Is this the right way to approach what I am trying to do? I'd like to use one 'holder text box' if possible.
I have a Flash movie (shell.swf) that loads in an external movie ("home.swf"). Within home.swf, one of two different swfs can load and I'd like to use a query string to determine which one loads.
I am using as2 to pass a variable from flash to my php and nothing is being passed! Here is the action script code that I put on my button:
Actionscript Code:[code]..........Now the amount of "5" is being inputted into a dynamic text field with the variable and instance name of amount (which, in the future, will be hidden ). This is working fine when clicking on the button. What I am trying to do, without success,is to get this value of "5" to my test.php and have it echoed and it's just not happening . This is my php script:
I'm getting "Nothing inputted" everytime.I've already tried the different routes for the amount.text such as:
Actionscript Code: on (release){ amount.text=5; form1= new LoadVars(); form1.amount= this.amount.text; form1.sendAndLoad("http://mywebpage.com/test.php",amount,"POST"); }[code].......
Extra info: I have put the .swf file and the .php file on the same level in the same folder on my server just to be sure and the amount.text dynamic text field and the button are on the same level in the .swf file.
I am using as2 to pass a variable from flash to my php and nothing is being passed! Here is the action script code that I put on my button:
on (release) { amount.text=5; form1= new LoadVars();
[Code]....
Extra info: I have put the .swf file and the .php file on the same level in the same folder on my server just to be sure and the amount.text dynamic text field and the button are on the same level in the .swf file.
I'm calling a php file from Flash and adding variables afterwards like so:It works fine if I copy and paste this directly into the web browser, however if I call it through flash, the address bar would end up like this: something.php?title=??Is there anything I can do from PHP or flash to encode/decode the string? that method worked perfectly.Everything is echoing out fine, however I'm now having some issues inserting the informtion into my database via MySQL, all of my fields are set to UTF-8. I'm getting some weird characters instead of the Chinese characters.
I had written this code out using Adobe CS3 and have recently upgraded to CS5. I haven't touched this site in forever and the last time that I did it worked great. The problem is as follows.type of page: galleryproblem: passing variablesthis is the original code that worked last time I checked it but has since stopped working.
function onClick(e:MouseEvent):void { trace(e.currentTarget.name);
I'm trying to access some variables from my parent in my child MC.
Parent code:
var data_history:String; function finish_checkUp(event:Event):void{ var checkUp_stat:String;
[Code]....
Now as you can see, i have tried the trace method, but with no luck. Flash doesn't report any errors regarding the trace method, but does report the two undefined vars (data_history). Ive tried to use the trace method above all the functions, at the top of the script, still the same errors though.
I am just trying to pass some variables from flash to php with getURL getURL("CompSummary.php?url3=" + url3, "_self"); URL33 keeps coming back as undefined
However I printed out url3 using dynamic text in the flash movie just to check it and it does indeed exist, and is defined. I also tried creating a string and passing that to getURL var path = "CompSummary.php?url3=" + url3; getURL(path, "_self"); still no luck.