Pass Frame Variable Via Query String Bettween 2 Swf In 2 Different Html Files
Hello, I have an swf movie embedded in an HTML. One of the links calls to another HTML with a different SWF embedded. I need to link back to the original HTML/SWF but to a certain frame within that SWF using HTTP query. I understand that I can do this with Javascript and by parsing the HTTP query. Can anyone direct me to a tutorial or give me some help?
Thank you
maknenoiz
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-02-2008, 01:54 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pass Variable Via Query String
i'll try to explain this the best I can.
I have a flash header that I need included in a shopping cart site that will have nav and the header descriptions for each site page. It has 2 navigations, top and side. Side nav only controls the flash itself to display stuff that won't be in the rest of the site, like an about us section. The top nav controls what page the shopping cart goes to AND the flash header display. For example, when I click on my top nav button 'systems' I need it to go the 'systems page' and change the flash header to display info about the systems. Now when the 'system' button is clicked the page changes to the 'systems' page but since its a header the flash just pops up on the new page reloaded to its original state. So how would I fix this? could flash pass a variable via the query string to determine what frame it should be on when going to a new page?
Passing Variable From An HTML Query String
HELP?
I am using the javascript
window.document.smoothie.SetVariable("_root.texty" , query);
in an HTML page, to pass the value in 'query' to a dynamic text box, 'texty' on the main timeline of my Flash movie.
The passing of the variable works, and can be seen on any one of these 3 pages:
http://www.runspotrun.com/test/page2.html?chewbacca
http://www.runspotrun.com/test/page2.html?hansolo
http://www.runspotrun.com/test/page2.html?obiwan
If the value of query is 'chewbacca' then what loads on the page is different than if the value is 'hansolo' and so on...
The passing of this variable works, EXCEPT - one needs to RELOAD the page to see it. When the movie/page first loads, the value doesn't appear. If it is reloaded, then the value appears. A following visit to the same page, even passing a different variable will work fine also. It's just that very first visit, the first time the movie is opened on a particular browser.
After many hours of trying to figure this out, I am at a loss. Can anyone help me with this please?
ThankS!
mark
Can You Still Pass Vars Through A Query String?
I'm trying to pass variables in through a query string appended to my url like so,
http://www.mydomain.com?myVar1=value1&myVar2=value2
From what i've read am i correct in thinking that i should be able to access these properties through 'this.loaderinfo.parameters'?
I don't seem to be able to get this to work for some reason? I'm able to get it tworking when passing in Flashvars through my html and then accessing them through the loaderinfo.parameters object, but not through a query string? Anyone got any ideas? Should this be possible?
Also i was wondering it there's any foreseeable issue passing in values both through Flashvars and a query string or should the loaderinfo.parameters object be populated with all the values?
cheers.
[F8] Dynamic Query String & Pass Variables To And Fro Php
Hi!
I have a webpage that needs to load a variable from query string and then the swf sends this variable to php to search it in databse and return respective entries.
My trouble is the page where the swf is placed in an HTML page whose URL is something like this : http://www.mysite.com/variableName=dynamicValue
Actually this is a link thats sent in an email. When clicked it loads this page. Here http://www.mysite.com/variableName= is static, but dynamicValue is a 15 letter randomly generated code.
I wanted to know is it possible to pass this dynamic value of the variable into my swf. If so, how to do that.
My second query is I wanted to send this variable from flash to a php file which will search it in a database and return related entries to flash. Now, I've done this seperately, that is, send variables to php by post method and get variables from php by get method. But I dont know how to do these two operations in one single call.
I am using Flash 8, though i'm exporting the movie to flash 6 player compatible and actionscript 2. Any help is welcome. Please let me have the feedback.
thanks
ashwin.
Pass Variables Into Flash Via Query String
I used to do this all the time to pass in simple values to Flash but with Flash 8 it doesn't seem to be working properly. I've stripped it down to it's most basic and it still doesn't seem to be working. I've got a test page here:
http://icglink.com/flashtest/
The top set uses the standard object/embed method, the left one passing in a 0, the right passing in a 1. Both use the variable named previousvisitor.
The bottom set use the same variable and value structure, but with the swfobject javascript call instead of the object/embed method.
I've got a case statement on the 5th frame that tests the incoming variable and directs the playhead to one frame label or another. The idea is that if someone has come to the site for the first time, they'll get to see a video. If not, they'll get a still frame with a "play video" button.
I'm also including a link to the FLA (version 8 remember).
http://icglink.com/flashtest/cookieTEST.fla
So does anyone have ANY idea why this isn't working correctly? I really need to get this working and it should be dead simple.
AMFPHP - Can't Pass Variable Into SQL Query
Hey guys,
Yeah, I know there's a Flash Remoting forum, but the last post there is months old and gathering dust. So here goes...
Just getting to grips with AMFPHP but I've run into an annoying problem tat I can't seem to work out.
OK, this works, no problem:
PHP Code:
/**
*queries Moodle FlashMod DB table only if logged on as user
*@returns recordset (array) of Word Search activity records
*/
public function get_wordsearch_records()
{
return mysql_query('SELECT * FROM `mdl_flashmod_results` WHERE `swfname` = 'Word Search' ');
}
But this just returns false:
PHP Code:
/**
*queries Moodle FlashMod DB table only if logged on as user
*@returns recordset (array) of input activity records
*/
public function get_wordsearch_records($activity_type)
{
return mysql_query('SELECT * FROM `mdl_flashmod_results` WHERE `swfname` = $activity_type ');
}
I've also tried all sorts of other combinations of quotes, re-setting the variable in the PHP file, etc. but I always get false unless I hard code the SQL query.
Any help?
Pass Variable To Swf To Query Database
I am trying to create a page that lets a user preview mp3’s. The mp3s file locations are stored in a database and there is an <cfoutput query > that takes say the mp3 file ids and places it in the swf file. The swf file trys to call the database and loads the file.
I am having major difficulty as I am not an actionscript programmer.
Attach Code
HTML PAGE:
<cfoutput query =”myQueryName”>
<object …>
<param name="movie" value="mp3player.swf?fileID=#myQueryName.fileIDnumber#" />
…othercode.
</object>
</cfoutput>
ActionScriptPage:
var musicPlays:Boolean = false;
var theSound:String = LoadVars(URL.s);
var loopTune:Sound = new Sound();
loopTune.onLoad = function(success:Boolean) {
if (success) {
loopTune.start(0, 999);
musicPlays = true;
_root.musicPlayer.gotoAndStop("playing");
}
};
loopTune.loadSound("s", false);
musicPlayer.playStop.onPress = function ():Void {
if (musicPlays) {
this._parent.gotoAndStop("stopped");
loopTune.stop();
musicPlays = false;
} else {
this._parent.gotoAndStop("playing");
loopTune.start(0, 999);
musicPlays = true;
}
};
Variable From Url Query String
simple ish
i understand the whole moviename.swf?variablename=content format to pull a variable into flash
but i cant seem to apply that formatting to the new method that dreamweaver uses flash
any ideas?
Code:
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','700','height','273','src','script4_pressures','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','script4_pressures' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="700" height="273">
<param name="movie" value="script4_pressures.swf?page=climate">
<param name="quality" value="high">
<embed src="script4_pressures.swf?page=climate" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="273"></embed>
</object></noscript>
i should be able to take the "page" var and use it, but its not working, could this be something to do with the dreamweaver fix for embeds?
cos my browser is using javascript it's not getting to the <noscript> tag
how can i parse the url using the above format?
any help would be appreciated
thanks
ds
Getting A Variable From Query String In The URL
Hello all, heres what Im trying to do:
Im linking to a HTML page using a link like this <a href="www.myhtmlpage.html?MyVar">To view your profile click here</a> What I want is for the flash file on this html page to read in the url and get the passed variable MyVar. How is this done, or is there a better way of doing this?
Any help would be greatly appreciated
Thanks, -L
Query String Variable In A Loaded SWF
Hi there, this is what i would like to happen.
- A Variable is set in the query string of the HTML
e.g. flash.swf?number=1
- In flash.swf, a movie is loaded into a container using the if function
Code:
if(number == 1){
loadMovie("my_mc.swf", loadhere);
}
- However, I would like the loaded movie (my_mc.swf) to also read this variable and play an action. For example
Code:
if(number == 1){
loadMovie("my_mc.swf", loadhere);
_root.loadhere.gotoAndStop(2);
}
In theory this should work, but it just doesn't. Anyone got a solution?
I've tried levels to no success as well.
Passing A Variable To A Query String
I am trying to create a form in Flash that passes variables to a query string. Simple enough, but when my variables have an underscore (eg variable_one) Flash coverts the underscore to %5F. I noticed that it seems to convert all non letter or number characters to something else. Unfortunately I dont have the option to change the names of the variables I am passing.
This is the code:
submit.onRelease = function () {
getURL ("http://www.actionscript.org","", "GET");
};
Has anyone encountered this? Help Please!
Setting A Variable From A Query String...
I'm creating a banner for a client that pulls in images via XML (sub_banner.xml.php) and depending upon which section of the site the user is in, PHP writes a query string sent via flashvars to set which section images to pull in.
The URL for example, after the query string is set for 'conferences' section of the site will be: sub_banner.xml.php?headerImages=conferences
All the PHP is in place, I'm just having trouble setting the query string variable (headerImages) in flash.
I've tried: var headerImages:String = headerImages;
Any idea on how to set a variable passed through flashvars??
My background is HTML/CSS based and still learning AS2 so any help is much appreciated!
Actionscript Variable From PHP Query String
Hi All,
I all rather new to the scripting side of flash, please can someone advise me on where I'm going wrong.
I'm send the variable 'id' via both the movie URL (value = "1001.swf?id=1001") and within the FlashVars (value = "id=1001").
I've been tearing me hear out try to get the actionscript to write the 'id' within a dynamic text instance box.
Please help and thanks in advance
Pass String Variable Into XML ULR
I am trying to pass a variable through "strSource:String" so that i can dynamically tell the player to load different videos depending upon which page it is on.
This works:
Code:
var strSource:String = root.loaderInfo.parameters.playlist == null ? "includes/video1.xml" : root.loaderInfo.parameters.playlist;
function initVideoPlayer():void {
// create a new net connection, add event listener and connect
// to null because we don't have a media server
ncConnection = new NetConnection();
ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ncConnection.connect(null);
// create a new netstream with the net connection, add event
// listener, set client to this for handling meta data and
// set the buffer time to the value from the constant
nsStream = new NetStream(ncConnection);
nsStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nsStream.client = this;
nsStream.bufferTime = BUFFER_TIME;
// attach net stream to video object on the stage
mcVideoControls.vidDisplay.attachNetStream(nsStream);
// set the smoothing value from the constant
mcVideoControls.vidDisplay.smoothing = SMOOTHING;
// create new request for loading the playlist xml, add an event listener
// and load it
urlRequest = new URLRequest(strSource);
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, playlistLoaded);
urlLoader.load(urlRequest);
}
Doesnt work if i try it like this:
Code:
var btnContent1:String = new String("includes/video1.xml");
var strSource:String = root.loaderInfo.parameters.playlist == null ? btnContent1 : root.loaderInfo.parameters.playlist;
Does anyone know why this is?
I can even put the URLRequest in as "includes/" + "video1" + ".xml" and it will work but as soon as i try to trade the "video1" for a string Variable it cannot find it.
My End hope to pass this variable through would be to have it on the HTML page where i could then dictate the exact path for the video XML
Code:
// source variables from HTML/js param
var btnContent1:String = root.loaderInfo.parameters["vOne"];
var btnContent2:String = root.loaderInfo.parameters["vTwo"];
var btnContent3:String = root.loaderInfo.parameters["vThree"];
Thanks for any help
will
Pass String Variable Into XML ULR
I am trying to pass a variable through "strSource:String" so that i can dynamically tell the player to load different videos depending upon which page it is on.
This works:
Code:
var strSource:String = root.loaderInfo.parameters.playlist == null ? "includes/video1.xml" : root.loaderInfo.parameters.playlist;
function initVideoPlayer():void {
// create a new net connection, add event listener and connect
// to null because we don't have a media server
ncConnection = new NetConnection();
ncConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ncConnection.connect(null);
// create a new netstream with the net connection, add event
// listener, set client to this for handling meta data and
// set the buffer time to the value from the constant
nsStream = new NetStream(ncConnection);
nsStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nsStream.client = this;
nsStream.bufferTime = BUFFER_TIME;
// attach net stream to video object on the stage
mcVideoControls.vidDisplay.attachNetStream(nsStream);
// set the smoothing value from the constant
mcVideoControls.vidDisplay.smoothing = SMOOTHING;
// create new request for loading the playlist xml, add an event listener
// and load it
urlRequest = new URLRequest(strSource);
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, playlistLoaded);
urlLoader.load(urlRequest);
}
Doesnt work if i try it like this:
Code:
var btnContent1:String = new String("includes/video1.xml");
var strSource:String = root.loaderInfo.parameters.playlist == null ? btnContent1 : root.loaderInfo.parameters.playlist;
Does anyone know why this is?
I can even put the URLRequest in as "includes/" + "video1" + ".xml" and it will work but as soon as i try to trade the "video1" for a string Variable it cannot find it.
My End hope to pass this variable through would be to have it on the HTML page where i could then dictate the exact path for the video XML
Code:
// source variables from HTML/js param
var btnContent1:String = root.loaderInfo.parameters["vOne"];
var btnContent2:String = root.loaderInfo.parameters["vTwo"];
var btnContent3:String = root.loaderInfo.parameters["vThree"];
Thanks for any help
will
Passing Variable To FLVPlayback Via Query String
This seems very easy but I am stuck here....
Here's the html that I'm trying to pass the flv name to the FLV component
Attach Code
In the html
<param name="movie" value="/proxy/MC-video-component.1.swf?flvName=vod/q1_2009_mkt_story">
and in AS i have an instance of the FLVPlayback component on the stage
var flvName;
myFLVPlayback.source = "rtmp://myFMSserver.org/" + flvName +".flv";
Any help?
Jumping To A Frame Based On Query String
Is there a way to jump to a specific frame in a flash movie based on the query string in the url?
For example, if the url ends in "flashmovie.html?frame=5" how can I grab the value of the frame variable and make the flash movie jump to that frame?
How Do I Pass A String Variable To Javascipt?
In my actionscript, I have this variable pic="pic.jpg". I want to use it like this but it doesnt work:
getURL("javascript: OpenWindow(pic, 'newWindow','')");
It says the pic variable is undefined.
This, works:
getURL("javascript: OpenWindow('pic.jpg', 'newWindow','')");
But I do not want to use a literal directly like that.
How can I pass this variable to javascript so that it will recognize it as containing a string?
Simple Variable Pass From URL String
help! i know there is a simple solution to this, but I just can't find an answer anywhere. so i'm posting it here in hopes that some kind soul will pitty me and free me from this frustrating pothole.
What i'm trying to do is pass a variable to a flash file via a URL string... i.e.
http://www.needananswer.com?pothole=12
...and for the flash file to be able to receive and use it.
HOW?
HELP NEEDED With Sorting Query String Into Variable Array?
Hi,
I need to sort a query string with a number of variables into an array of variables..
Here is the query string being sent to the swf file:
order.swf&LOCT0=bedroom&LOCT1=dwelling&LOCT2=kitch en&LOCT3=landing
Below is the script im using:
Location = new Array;
for (i=0; i<"LOCT"; i++) {
Location[i] = eval("LOCT"+i);
It doesnt work! what is wrong in my script??? Please help!
thanks,
Shahid
AS 2 Problems Setting Variable From Query String In Flash...
I'm creating a banner for a client that pulls in images via XML (sub_banner.xml.php) and depending upon which section of the site the user is in, PHP writes a query string sent via flashvars to set which section images to pull in.
The URL for example, after the query string is set for 'conferences' section of the site will be: sub_banner.xml.php?headerImages=conferences
All the PHP is in place, I'm just having trouble setting the query string (headerImages) in flash. I've tried: var headerImages:String = headerImages;
My background is HTML/CSS based and still learning AS2 so any help is much appreciated!
Sending Query String Flash To Html
hi all,
I am new to here this forum im using movie clips here long time ago, anyway could you pls tell me how to send query string flash to html. I found one site they are doing html to flash they didn't mention about how to send flash to html. I just doing one flash one that i need to using this option pleas tell me
cheer
code finder
Dynamically Embedding Swf In HTML From Query String?
What I'm trying to do is use a query string to get the name of a swf to embed into the HTML.
Example: www.myurl.com?name=interface1
Then in my code for embedding the swf I have something like this.
Example:
Code:
<div align="center">
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject(name+".swf", name, "785", "575", "8", "#FFFFFF");
so.addParam("quality", "high");
so.write("flashcontent");
</script>
</div>
Does anybody know a way to make this work? I would be greatful for any input
Flex Read HTML Query String In AS3/SWF
Hi All,
Please help, I'm stuck and don t have a clou what to try further.
I suppose the error is in my AS3/MXML, not in the HTML.
A simple demo AS3/MXML would be VERY VERY welcome :-)
I am tryin to read HTMl query script (or FlashVars) in my AS3 code, using loaderInfo.parameters . I have read the examples here and on various other sites, but I cannor get it to work, keep getting Error #1009: Cannot access a property or method of a null object reference. So apparently the Object does not get set, but I do not know why.
Here's the relevant HTML (embedded in noscript and object tags), like example on this forum.
<param name="movie" value="URL_oef_3.swf?var_1=XYZ" />
...
<embed src="URL_oef_3.swf?var_1=XYZ" quality="high" bgcolor="#ffffff"
Note: I also tried FlashVars in both HTML and Javascript. Same error. Found full HTML-examples on the net, so I guess this is not the problem.
Here's the full MXML app (I build a SWF from it before running it in the HTML, obviously).
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml
creationComplete="initVars()"
>
<mx:Script>
<![CDATA[
import flash.display.LoaderInfo ;
import flash.display.Loader ;
public function initVars():void
{var testval:String = this.loaderInfo.parameters.var_1;
labeltje.text = testval ;}
]]>
</mx:Script>
<mx:HBox>
<mx:Label text="Name: "/>
<mx:Label id="labeltje" fontWeight="bold"/>
</mx:HBox>
</mx:Application>
Thanks a lot!
B
Passing Variables From HTML To Flash Using Query String
Am using query strings in HTML to pass variables to my flash movie so I can use the same movie but different title on each page. See www.gogojuicebars.com
Works fine when I test locally, but when uploaded the movie seems to display only the first "welcome" title on each page until you have clicked all of them. Then it works correctly???? Is almost like the flash movie is loading before the varaibles can be passed, but how can this be??
Any ideas on how to fix this?
Append Variables On A Query String In HTML Tags
Hi.
Okay, I have a single navigation swf that I want to be able to use over several html pages. I want my swf to be able to react to whichever html page it is on so that dependant on page one button will always be frozen to synchronize with the page title.
The easiest way I could think of (and most browser compatible) was simply to append a variable into the tags on each html page in the way that is defined in this Macromedia technote:
technote: Different approaches to setting variables in a Flash movie
Sounds simple.
But... I followed the directions (thrice) and it no workee! Nothing appears in my cursed test textfield.
I was hoping that someone might be able to pull me into the light, or suggest any other options? Can anyone else get this to work?
Thanks.
pinK
[F8] Html Links -reload The Page And Get Info From Query String
I need a proof of concept or a simple way if there is one of allowing authors to create INTERNAL links to pages in my flash application.
The application is a learning resource which uses a string notation such as 02030004 to navigate to that resource page. This is internal to the application.
If I can get authors to put in a html <a href="... link then set this number in the query string can I get flash to read this if it runs off of a CD rom.
Is this going to work? and can I get the query string value if it runs from the cd rom. I dont like this way personally, I dont want to reinstantiate the movie and all the variables etc it will raise all kind of bugs to my mind. But how can I do it otherwise ?
Pass Variable Between Swf Files
Hi there,
I know there are quite a few thread regarding this kind of issue. However, I couldn't figure it out how I accomplish the goal. So, here is what I need.
I have a main swf file called main.swf. I have an external child swf file called child swf. Those two swf files are all written in flash 9 and as3.
If a user click a button, child.swf will load. Until this part, I got it to work.
However, I have to pass variables from main.swf to child.swf. So, how do I pass variable from one swf to another swf and also how to receive those passing variables?
FYI: I want to pass variables through swfs not javascript or html.
Thanks for your input.
- port
Pass A Variable To A Different Frame...
I am having trouble on one of my games... when the root of my game changes to a different frame, it loses the variables that I had... how can I pass them to the frame that I go to?
Thanks!
How Do You Pass A Variable In A Function To Another Frame?
I'm building an app where I ask a user to name a project to start.
When they click the start project button, it places a movieclip (new_project_window) on the stage that has a dynamic text field (project_name) and a button (new_project_window_button) in it.
When the button is clicked, it triggers a function that writes out a folder on the user's drive with whatever the user has put in the dynamic field (I'm using Zinc for that).
All this is working exactly as I want it to. The problem now is after they start a project, I want to move them to another frame where they fill in some info about the project (name, address, etc.). All this info will go to an xml file that will be in the folder they created above, with the name of the folder being the value of the dynamic field.
So I need to pass the value of the dynamic text field, which is captured inside the function I've created, on to the next screen.
Here is the code of the function I've written:
Code:
//code for starting a new project
new_project_window.new_project_window_button.onPress = function():Void {
if (new_project_window.project_name.text == ""){
new_project_stop();
}
else {
//creates file structure for a new project, relative to root level of app
mdm.FileSystem.makeFolder(currentPath+"/projects/"+new_project_window.project_name.text);
mdm.FileSystem.makeFolder(currentPath+"/projects/"+new_project_window.project_name.text+"/xml");
mdm.FileSystem.makeFolder(currentPath+"/projects/"+new_project_window.project_name.text+"/images");
mdm.FileSystem.makeFolder(currentPath+"/projects/"+new_project_window.project_name.text+"/pdfs");
//parses the master xml file for new project titles
project_names.ignoreWhite = true;
var pRootNode:XMLNode = project_names.firstChild;
var pChildren:Array = pRootNode.childNodes;
//writes out new xml file of master projects, appending new project name to list
var LFCR:String = "
" + "
";
var xmlStr:String ="";
xmlStr +="<projects>";
for (var i = 0; i < pChildren.length; i++) {
xmlStr +="<project>"+pChildren[i].firstChild+"</project>";
}
xmlStr +="<project>"+new_project_window.project_name.text+"</project>";
xmlStr +="</projects>";
mdm.FileSystem.saveFile(save_projects_xml, xmlStr);
}
}
So what I need to know is how do I capture the value of new_project_window.project_name.text, set it as its own global variable and pick that variable up on the following frame.
Any clues how to do this? Any help greatly appreciated.
Thanks
JMR
*
Pass Variable From HTML
I want to pass a variable from an HTML page to an SWF file that lives in a different HTML page.
Can anyone help me with this?
Thanks.
Pass Variable To GotoAndPlay Frame Number
Hi, I'm just beginning in actionscript so I might be looking at this the wrong way!!
I have created a simple slider that gives me a variable depending on where the slider is positioned i.e. the percentage.
I then have a simple movieclip 100 frames long where a red square turns into a blue square (shape tweened then converted to key frames).
I want this movieclip to jump to whatever frame corresponds to the percentage of the slider i.e. 20% would be frame 20
100% would be frame 100 etc.
I can't work out how to assign the percentage variable as a frame number in the gotoAndPlay (or gotoAndStop).
Help!!
Thanks
Variable Pass From Rollover Buttons To AS On Frame
Hi
I am creating a weather forecast in which i have to create many rollover buttons by which i can pass different URL(i.e. file path which has the zip code & other code) which goes to action script on frame 1 which has all other coding for weather. I know it sound confusing kindly help.
[FMX] LoadMovie Pass Frame Label Variable?
Basically this script works just fine and loads the appropriate movie. The transistion exit frame also works correctly. What I am trying to do is load the movie site_services.swf and jump to frame label "database" after the preloader. I was attempting to use _root.contents.FLabel = "database";
to set the variable.
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "site_services";
_root.contents.FLabel = "database";
_root.contents.loadMovie("site_services.swf");
} else if (_root.currMovie != "site_services") {
if (_root.contents._currentframe>=_root.contents.exit ) {
_root.currMovie = "site_services";
_root.contents.gotoAndPlay("exit");
}
}
}
When the external movie loads in it hits the preloader of that movie and then plays to a frame with an action
_root.contents.gotoAndStop(_root.contents.FLabel);
I was hoping that the button script above would pass the Flabel "database" to this there by jumping to the correct framelabel. Unfortunately this doesn't work and I am just wondering the best way to go about it. On the loadmovie should I do something like this:
_root.contents.loadMovie("site_services.swf", _root.contents.FLabel );
or specific the Flabel at the beginning of the external loaded movie.
Anyways, any help would be appreciated.
Thx
[FMX] LoadMovie Pass Frame Label Variable?
Basically this script works just fine and loads the appropriate movie. The transistion exit frame also works correctly. What I am trying to do is load the movie site_services.swf and jump to frame label "database" after the preloader. I was attempting to use _root.contents.FLabel = "database";
to set the variable.
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "site_services";
_root.contents.FLabel = "database";
_root.contents.loadMovie("site_services.swf");
} else if (_root.currMovie != "site_services") {
if (_root.contents._currentframe>=_root.contents.exit ) {
_root.currMovie = "site_services";
_root.contents.gotoAndPlay("exit");
}
}
}
When the external movie loads in it hits the preloader of that movie and then plays to a frame with an action
_root.contents.gotoAndStop(_root.contents.FLabel);
I was hoping that the button script above would pass the Flabel "database" to this there by jumping to the correct framelabel. Unfortunately this doesn't work and I am just wondering the best way to go about it. On the loadmovie should I do something like this:
_root.contents.loadMovie("site_services.swf", _root.contents.FLabel );
or specific the Flabel at the beginning of the external loaded movie.
Anyways, any help would be appreciated.
Thx
Variable Pass From Rollover Buttons To AS On Frame
Hi
I am creating a weather forecast in which i have to create many rollover buttons by which i can pass different URL(i.e. file path which has the zip code & other code) which goes to action script on frame 1 which has all other coding for weather. I know it sound confusing kindly help.
Pass Flash Variable To Html
i have a map i'd like someone to click on
a couple locations and have those show up
as html. any ideas? i just need a kick in the head here?
Pass Variable From 1 Swf To Another Swf On The Same Html Page? Help
I have 2 swf. I do not want B.swf to load until A.swf get the the certain point. They both are on the same html page.
Is there a way I could pass the variable (say if I send a _global in A.swf) from one swf to another if they are on the same html page?
thank you so much!
Pass Html Variable Without AC_RunActiveContent.js
Well I have had no luck trying to pass a variable from an html page to my swf.
Here is what I have tried
html code
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="compass" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="compass.swf?mX=90" />
<param name="flashvars" value="something=somethingelse&apples=oranges" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="compass.swf?mX=90" quality="high" bgcolor="#ffffff" width="550" height="400" flashvars="something=somethingelse&apples=oranges" name="compass" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
And here is what I have in the document class
PHP Code:
var tf:TextField = new TextField();
addChild(tf);
tf.autoSize = TextFieldAutoSize.LEFT;
tf.border = true;
tf.appendText("params:" + "
");
try {
var keyStr:String;
var valueStr:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
valueStr = String(paramObj[keyStr]);
tf.appendText(" " + keyStr + ": " + valueStr + "
");
}
} catch (error:Error) {
tf.appendText(error.toString());
}
What am I doing wrong, any ideas? This was so easy before AS3
Pass Html Variable Without AC_RunActiveContent.js
Well I have had no luck trying to pass a variable from an html page to my swf.
Here is what I have tried
html code
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="compass" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="compass.swf?mX=90" />
<param name="flashvars" value="something=somethingelse&apples=oranges" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="compass.swf?mX=90" quality="high" bgcolor="#ffffff" width="550" height="400" flashvars="something=somethingelse&apples=oranges" name="compass" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
And here is what I have in the document class
PHP Code:
var tf:TextField = new TextField();
addChild(tf);
tf.autoSize = TextFieldAutoSize.LEFT;
tf.border = true;
tf.appendText("params:" + "
");
try {
var keyStr:String;
var valueStr:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
valueStr = String(paramObj[keyStr]);
tf.appendText(" " + keyStr + ": " + valueStr + "
");
}
} catch (error:Error) {
tf.appendText(error.toString());
}
What am I doing wrong, any ideas? This was so easy before AS3
How To Pass A Variable From HTML To Flash
I have built my flash ad banner in Flash 9 and now want the HTML code to pass the url over to the flash movie that it should jump to when clicked.
The info in the help file seems out of date for the latest HTML template as it uses mainly JavaScript to get round IE's dreadful embeding issue. So my problem is, how do I pass a variable from the HTML to the actionScript specified int he Help file (running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
}
};
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Advert_long</title>
<script language="javascript"> AC_FL_RunContent = 0; </script>
<script language="javascript"> DetectFlashVer = 0; </script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable version
// embed the flash movie
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
}
// -->
</script>
<noscript>
// Provide alternate content for browsers that do not support scripting
// or for those that have scripting disabled.
Alternate HTML content should be placed here. This content requires the Adobe Flash Player.
<a href="
Please Help Can I Pass A Variable Between 2 Swf's That Are On Different Html Pages?
Hey,
Does anyone know how to pass a variable (string) from one swf to another if there in separate html pages?
I assume I’d have to send the variable from the first page and load it into the second but I don’t know what functions or code I should be using. Any suggestions would be a HUGE help.
Thanks
If it helps: I’m creating a log in and sign up sheet that can be accessed from several sites. I’d like to record which site the user has come from when they signup.
Thanks
Pass An Action From Frame In Html To Another One
Hi all,
I have a problem. I have a HTML page with have two FRAMES, left and right. One movie in left FRAME and another in right frame.
I want to pass an action from the movie on the left FRAME to de right one, but I dont Know how.
Could anybody help me, please?
Thank you.
How To Pass Data Across Swf Which Are Called Thru Different Html Files
Urgent:
Does anyone know how to pass data across swf which are called thru different html files?
For examlpe: There is file called "Interface.swf" which have a variable called userName. There is a button in Interface which opens a file called "Help.htm" which inturns calls a file "Help.swf". I need the variable userName from Interface.swf to Help.swf. I have tried global variable but its not being passed as these are called thru two different html.
So, does anyone know the solution to solve this problem?
thanks in advance...
How To Pass Data Across Swf Which Are Called Thru Different Html Files
Urgent:
Does anyone know how to pass data across swf which are called thru different html files?
For examlpe: There is file called "Interface.swf" which have a variable called userName. There is a button in Interface which opens a file called "Help.htm" which inturns calls a file "Help.swf". I need the variable userName from Interface.swf to Help.swf. I have tried global variable but its not being passed as these are called thru two different html.
So, does anyone know the solution to solve this problem?
thanks in advance...
How To Pass Data Across Swf Which Are Called Thru Different Html Files?
Urgent:
Does anyone know how to pass data across swf which are called thru different html files?
For examlpe: There is file called "Interface.swf" which have a variable called userName. There is a button in Interface which opens a file called "Help.htm" which inturns calls a file "Help.swf". I need the variable userName from Interface.swf to Help.swf. I have tried global variable but its not being passed as these are called thru two different html.
So, does anyone know the solution to solve this problem?
thanks in advance...
How To Pass Data Across Swf Which Are Called Thru Different Html Files?
Urgent:
Does anyone know how to pass data across swf which are called thru different html files?
For examlpe: There is file called "Interface.swf" which have a variable called userName. There is a button in Interface which opens a file called "Help.htm" which inturns calls a file "Help.swf". I need the variable userName from Interface.swf to Help.swf. I have tried global variable but its not being passed as these are called thru two different html.
So, does anyone know the solution to solve this problem?
thanks in advance...
Pass Variable From Flash To HTML And Back?
OK I have a HTML page with a swf(created in Flash MX) on it. The user can choose between 2 buttons (basically to show text or to hide text). I need to somehow keep their option (hidden or shown text) the same on the next HTML page which has a different swf. I'm thinking I need to set a variable (ie 1 for turn on text, 2 for turn off text) and then send that variable to the HTML page where it somehow sends it to the next HTML page that is opened where the new swf reads the variable (1 or 2) and responds accordingly....
Can anyone help me work this issue out???? I'll probably need help in setting up both the swfs and the HTML code to make it all happen. I have limited experience in javascript for the HTML and more, but not much, experience with actionscript.
I'd greatly appreciate any help I can get on this. Thanks in advance.
|