ActionScript 3.0 :: Pass A Variable Into An External SWF?

Jun 24, 2009

I've created a Flash video player that I regularly embed into HTML pages and use flashvars to update the path of the video to be played. The variable that I reference is named "videoURL" and is passed as a flashvar using "'flashvars', 'videoURL=myVideo.flv,"

The problem that I am having is when passing that same variable into my SWF when it is loaded externally into a new Flash file. I load the child SWF into my main FLA using the Loader class and I am able to run a successful trace on my variable using "trace(MovieClip(loader.content).videoURL);"

Obviously, I can't overwrite the variable with "videoURL = 'newVideo.flv'" as I have not defined videoURL in the main FLA. So my question is, how do I target my child SWF and what method do I use to pass it a variable? I'd assume that the correct method would also allow me to call a function from within the child SWF.

I hope that someone can explain this to me as every "solution" I've come across either suggests using HTML or Javascript, references AS2, or simply doesn't directly address my problem.

View 7 Replies


Similar Posts:


AS3 :: Flash - Pass External XML A Variable?

Mar 12, 2010

I want to pass external XML a variable. How do I do this?

WHAT I'M AFTER

- update my variable with COUNT XML

WHAT I'M NOT GETTING

- The integer to String values

- How to pass XML to a variable

time.xml
<?xml version="1.0" encoding="utf-8"?>
<SESSION>
<COUNT TITLE="starting position">-77777</COUNT>
</SESSION>

[code]....

errors:coercion errors and null references with anything I attempt.

View 1 Replies

ActionScript 3.0 :: Pass A External Variable To A Function?

Aug 6, 2010

I have an external log file which name changes each session, with the format XXXXX.log

I need to load it inside a swf to show its data, but each time the logs name is different, I need to open the .fla, changing the name of the file and then republishing the swf.

So I have made a simple script to load another .txt, to type manually in it the 5 number of the logs name and load it externally inside the swf:

Code:
var logNumLoader:URLLoader = new URLLoader();
logNumLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
logNumLoader.addEventListener(Event.COMPLETE, loadedLogNum);

[Code]....

While I cannot assign the value of logNum to the last function, the .log cannot be opened.

View 2 Replies

ActionScript 3.0 :: Pass Variable From External File Into Fla?

Jul 30, 2009

I have a simple menu class for site navigation[code]...

I would like to be able to listen to the value of 'btnName' inside my .fla and respond accordingly.

Is it possible to pass this variable from an external .as file into my .fla?

View 10 Replies

Flash :: AS3 - Pass External Variable To A Function

Aug 4, 2010

I have an external log file which name changes each session, with the format XXXXX.log I need to load it inside a swf to show its data, but each time the log's name is different, I need to open the .fla, changing the name of the file and then republishing the swf. So I have made a simple script to load another .txt, to type manually in it the 5 number of the logs name and load it externally inside the swf:

[Code]...

View 2 Replies

ActionScript 3.0 :: Pass External Text As A Variable?

Aug 13, 2010

I have a video player which plays several files which I can replace externally. I want a viewer to be able to click on a movie and be taken to a specified web page (HTTP)

I do not want to have to open and update the swf every time I change the movies.

Can I load the contents of a .txt file which contains the web address and the use that veriable to replace the address in navigateToURL command.

View 1 Replies

Actionscript 3 :: Pass A Variable From The Main Fla To External As File?

Mar 7, 2012

I'm beginner in actionscript 3, and I'm trying to pass a variable from the main fla to external as file.

View 1 Replies

ActionScript 2.0 :: Pass URL String From External File To AS Variable (dynamic File Names)

Nov 17, 2004

I have a movie player that works fine when i hard-code the url value in the video function, but when i try to pass that url/file path from an external file, the video doesn't load. I suspect that there is something i'm doing wrong with the quotes. What am i doing wrong?

[Code]...

View 5 Replies

ActionScript 2.0 :: Pass A Variable As Well And Can't Seem To Escape To Pass It?

Apr 6, 2008

Trying to pass a variable as well and cant seem to escape to pass it. How can I pass using window.open as such: Trying to pass (pid) all i get back is (pid) and not actual pid.How to on a jscommand?

Code:
something.onRelease = function () {
var jscommand:String = "window.open('http://www.someform.php?proj= + (pid)','win','height=200,width=300,toolbar=no,scrollbars=yes');"; getURL("javascript:" + jscommand + " void(0);"); }

I can do a standard getUrl("http://www.someform.php?proj=" + (pid), "_blank"); works fine but no control over window properties.

View 1 Replies

Javascript :: Pass The Variable So That The Resulting Line Of Code Doesn't Have The Quotes Around The Variable Value?

Oct 3, 2011

I'm trying to pass the contents of variable playnoyes to the long line of code below to decide whether or not to autoplay the flash movie, but doing it as I have below, the resultant line of code has the variable in quotes and therefore the code doesn't execute it as expected. My question is, how can I pass the variable so that the resulting line of code doesn't have the quotes around the variable value.

var playnoyes='true';
var testtext = "<script type='text/javascript'>AC_FL_RunContent ('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.[code]....

View 3 Replies

ActionScript 3.0 :: Declare A Variable In PHP And Pass That Variable To My Flash File?

Mar 5, 2010

I am trying to do is declare a variable in PHP and pass that variable to my flash file. Right now i am simply trying to do 1 easy variable, more will happen in the future but i need to figure this out first.I have used other forums and they say try this and that, but nothing i do seems to work. here is my code.

PHP Code:[code].....

View 8 Replies

Pass A Variable With Brackets In The Variable Name?

Nov 20, 2010

I am trying to pass a variable with brackets in the variable name. Example

productoption[]="value";

Whenever I publish the file flash gives me an unexpected "]" error code. Is it possible to have a variable name with brackets? I tried to use the escape codes %5B%5D to pass the brackets but that didn't work also.

View 1 Replies

ActionScript 2.0 :: Pass Php Variable To Variable?

Nov 28, 2009

i write my own code for php and actionscript...and i had a problem with it.. How to pass php variable to action script variable?

[Code]....

View 3 Replies

IDE :: Pass Variable From One Swf To Another Swf?

Nov 12, 2009

can i pass variable from one swf to another swf. each swf is in separate html page.

View 3 Replies

ActionScript 2.0 :: Pass Variable Swf To Swf

Mar 23, 2009

I am able to pass a variable from an html link that loads a separate html file and instructs the embedded file to go to a specific frame. But - I now need a link within an swf file on one page to open a new page and tell that swf to start on a specific frame and it is not working. Here is the code I use for the first example - works like a champ:

[Code]....

View 1 Replies

How To Pass URL Variable To Flash

Oct 24, 2008

I want to put a variable at the end of a URL and have Flash "find" that variable. The url would be: [URL] "Campbell" is the variable I want to pass to Flash. I then have this script in the root timeline:
loadVariables (""+agent".txt", this);

I want "agent" to be replaced with Campbell. That way I can have it read a bunch of variables from the txt file. I tried this as well:
loadVariables (""+_root.agent".txt", this);
What am I missing in this?

View 9 Replies

ActionScript 1/2 :: Pass Variable From One Swf To Another?

Oct 15, 2009

I have declared one variable in one.fla file on a button press i am opening another swf file. [code]...

View 1 Replies

ActionScript 3.0 :: Pass Variable To PHP?

Sep 25, 2011

I use AS3 to pass variable to PHP. The script is as follows

<<Actionscript>> 
var urlFailLoader:URLLoader;
var urlFailVariables:URLVariables = new URLVariables();
var urlFail:String;

[Code]....

However, nothing is displayed as I type "http://localhost/moodle/flashtophp.php" in browser. Why is that?

View 3 Replies

Flash :: Pass One Variable From 1 SWF To Another?

Aug 4, 2009

Now I understand this has been asked to go from Parent to Child before, which is all well and good, but what I want to know is, how do I go about passing from a Child SWF back to the Parent?[code]...

View 2 Replies

Flash :: Pass Variable From One Swf To Another In As3?

Jun 28, 2010

I have a main swf in as3 and I load another swf in as3 in it. Now I want the main swf to pass variable to loaded swf.

View 2 Replies

ActionScript 3.0 :: Pass A Variable Between Swf?

Sep 29, 2009

I want to pass a variable from one swf to another that will be embedded in an html page that the first swf will open. Basically, I want to pass a variable with the URL of the image that the second swf should load.

I respect people that have this knowledge, and I am not asking you specifically for the code, but for some directions on how to make this happen.

View 6 Replies

ActionScript 2.0 :: How To Pass Php Variable

Nov 28, 2009

i write my own code for php and actionscript...and i had a problem with it..How to pass php variable to action script variable ?

e.g my php code (test.php) is

Code:
<?php
print"&phpVar=1";
?>

My action script code is

Code:
loadVariablesNum("test.php", 0, "POST");
if(phpVar == '1')
{

[code]....

The output should be "Condition A" Since phpVar = 1 ......The output of this script is always "Condition B" Means this script not detect "phpVar = 1" how to show this output "Condition A" by using php variable ?

View 4 Replies

ActionScript 3.0 :: Pass Variable From One Swf To Another In It?

Oct 19, 2011

I have two swf(a.swf anb b.swf) in as3 . Now I want pass variable From a.swf to b.Swf. i used the Loader Class.[code]...

View 6 Replies

ActionScript 2.0 :: Pass Variable From 1 Swf To Another

May 6, 2004

I have 2 SWF's on my website. They are separate though - not using loadmovie. I'd like to have my first SWF play and then trigger the 2nd SWF to play when the first one is done. How can I pass a variable from the 1st SWF to the 2nd? Is this possible?

View 1 Replies

ActionScript 3.0 :: Pass Variable To It?

Mar 16, 2011

I have been looking for this couple hours and still can't find the answer. I need to pass variable BUT only through URL as I need to use it as a target link in html (so I can't use <object> flashvars), look below.[url]...

View 2 Replies

ActionScript 2.0 :: [MX] Pass Variable From 1 Swf To Another

May 6, 2004

I have 2 SWF's on my website. They are separate though - not using loadmovie. I'd like to have my first SWF play and then trigger the 2nd SWF to play when the first one is done. How can I pass a variable from the 1st SWF to the 2nd?

View 1 Replies

CS3 : Pass A Variable Calculated In A Function

May 8, 2009

how I can pass a variable calculated in a function, to the stage.

View 9 Replies

ActionScript 3.0 :: Pass XML Variable To ChildMC?

May 24, 2009

I would like to pass an imported XML value to MC's for display, but I either get an error stating the variable doesn't exist if declared XML or a conflict error if String.[code]...

View 1 Replies

Flash8 :: Pass A Variable From A Url To Flash?

Nov 30, 2009

I have one swf with a button which, when clicked, needs to go to another swf in a different php page but to a specific frame, not the start of the movie.In the first swf I have:

register_btn.onRelease = function() {
getURL("http://www.myurl.co.uk?f=register");
}

[code].....

View 1 Replies

ActionScript 3.0 :: Pass Variable From An Swf To A Loading?

Feb 12, 2010

I have a situation where I allow the user to select the section of the site that they wish to go to. At the moment, I have a separate SWF for each section of the site, but I was wondering if it is possible to create 1 swf file and based on variables that are passed, it would load different data into the swf.

What I need to know how to do, is to pass those variables to the loading swf at run time so that it loads the correct items into the swf.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved