Pass Parameters From HTML To The SWF File?

Jun 13, 2009

I've created a very simple video player that I want to use with many different FLV files on my site. Rather than packaging SWF files with each FLV, I'd like to just design one SWF file and have the corresponding HTML file pass the URL of the FLV as a parameter to the SWF. I've read a lot about passing in parameters from HTML to SWF using AS3, and it seems pretty straightforward.  Here's an example of the code I created using Flash CS3 and ActionScript 3.0:
 
this.loaderInfo.addEventListener(Event.COMPLETE,loaderComplete);
function loaderComplete(evt:Event):void {
//traceText.text = "Loaded";

[Code]....
 
Note that I'm using the variable "userName" to pass the parameter.  Eventually I'd use a variable like "movieURL" to convey the actual URL of the FLV file.  In any case, when I run the code, I get ... nothing!  Nothing but a blank text box.  Both the HTML and SWF files are on my local machine.
 
If I uncomment the "//traceText.text = Loaded" line, the text box says "Loaded", which would indicate that the event listener is functioning properly.

View 9 Replies


Similar Posts:


ActionScript 3.0 :: Pass HTML Parameters Into SWF?

Dec 13, 2009

I'm working on a project where the HTML in which my main SWF is embedded will be called with a couple of dynamic parameters, like this:PHP Code:how to get that parameter into my SWF?

View 5 Replies

Linux :: Can't Pass Parameters To Flash Using 'file://' Protocol?

Sep 27, 2011

system infoflash player version: 10_1_102_65OS: linux debian, 6.0.2web browser: Mozilla Iceweasel 3.5.16problem descriptionI have a flash file that uses parameters to show output on the screen. unfortunately i don't have sources and can't modify/review it.shows correct flash in the browser.but when i try to load flash from fileflash can't read passed parameter and shows invalid outputit's really strange. because when i downgraded flash plugin (from 10_1_102_65 to 9) both protocols works! That is something occurred in the flash player above 9.unfortunately i can't use Flash Player 9 in my production environment so i should resolve the issue with Flash Player 10.

View 2 Replies

Flash :: Pass Parameters In Flex 3 To Variables In A Swf File Using Swfloader?

Apr 28, 2011

I've created a Flash Animation (CS5, ActionScript 3) and converted it to SWF. The flash animation needs the values of 3 variables (defined in the swf timeline) BEFORE it starts running in my Flex application. I've embedded the swf file using swfloader in Flex, but I need to pass the parameters from Flex into Flash before the animation starts. How do I do this?

The way I have my flex code setup below, the variables are not being updated. I get an exception every time it gets to the changeParams function because it can't find "Type", "Num1", etc.

Part of My flash code:

//These 3 variables need to be populated via Flex BEFORE the animation starts...
var Num2:int;
var Num1:int;

[Code]....

View 2 Replies

HTML :: Parameters Added But SWF File Not Looping

Mar 22, 2011

I have a .swf file that is not looping although I have added the parameter to do so. It plays just the once, and at the end of the video it stops instead of looping.
<div id="video">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="211" height="316" id="FLVPlayer" style="visibility: visible; ">
<param name="movie" value="FLVPlayer_Progressive.swf">
<param name="quality" value="best">
<param name="wmode" value="opaque">
[Code] .....

View 1 Replies

ActionScript 2.0 :: Pass XML File Path To Flash Via HTML URL

Oct 4, 2009

Our art gallery project has a list of several artists.Each artist links to a SWF gallery that will showcase their work.The SWF gallery opens in a popup window.We want to use XML files unique to each artist to call the content for the SWF.This will allow us to have one popup, calling the same SWF for all the artists.This means that the HTML link for each artist needs to pass the XML path for that artist to the SWF as a variable.We are using swobject to embed the SWF in the popup window.

View 9 Replies

ActionScript 1/2 :: Pass Variable Into HTML To Play A Flash File?

Feb 17, 2010

I'm trying to create a simple SWF file that can receive the name of a FLV file in the HTML file and play it since I have many FLV files.  Basically using the technique of FlashVars.  I've set the contentPath/source in the components to be blank, and set my actions in the first frame to be player.source = filename, as was instructed to do so in a Flash book I am reading. I then set the "filename" variable to a file in the same path as the web page in the HTML file, however, all I get is a blank Flash player skin.  The FLV file will not load.  I also tried setting the "filename" variable to load the FLV from a public website in the same domain and on another domain, but it still doesn't work.

View 5 Replies

ActionScript 3.0 :: How To Pass Parameters To .swf

Jun 12, 2009

want to make a sfw that receives parameters from the html tag. for example, when you embed youtube videos, in the <object> thingy you set the video you want to show. i want to do exactly the same, have a 'projector' (though not exactly videos), the swf knows what to do from the html tag params, and displays the right content. how do i red html params from the sfw (and how do i test it?).

also, is there any doumentation/examples on how to connect php/mysql to a flash movie?

View 2 Replies

ActionScript 3.0 :: Pass PHP Parameters To And From It?

Jan 17, 2011

I'm looking for the best methods to pass variables to a MySQL and receive variables from that database as well.

View 3 Replies

Flex :: How To Pass Parameters To A Swf

Jun 8, 2011

I am using FlashVars to pass params in the swf but it is not working.

Here is the html code:

[Code]...

View 2 Replies

Pass Url Parameters To A Swf Movie?

Oct 15, 2011

I am trying to load a swf file in a browser and pass url parameters to the flash movie. How do I access the url parameters in the flash movie in actionscript?[url]...

I did find pointers on passing parameters through embed/object tags, but nothing on passing url parameters (and accessing them) just through a browser url.

View 1 Replies

ActionScript 3.0 :: Pass Parameters Between Swf's?

Nov 24, 2009

I created a swf in swf where I have a video and also instantiate another swf using a loader.That other swf reads a xml (RSS) and displays a text with marquee at the bottom end ... What is wanted by main swf, pass parameters to another swf, being more specific, I want to pass the address (URL) of the RSS to be displayed.

View 1 Replies

ActionScript 3.0 :: Using FlashVars To Pass Parameters?

Oct 17, 2009

I am trying to use FlashVars to pass a parameter that will determine which graphic to load into my movie. The test actionscript code uses a dynamic text field called dText and is coded as follows (testing the FlashVars by passing them to a dynamic text field):

function loaderComplete(myEvent:Event){
var flashVars=this.loaderInfo.parameters;
dText.text=flashVars.userName; }
this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);

In my html code I am adding:
<PARAM NAME=FlashVars VALUE="userName=SamG" />
FlashVars="userName=SamG" // added to the embed tag

View 3 Replies

ActionScript 3.0 :: Pass Parameters Through Eventlisteners?

Jun 11, 2010

Inside a .fla file I have some buttons and each button will tween a different image to the stage. All the images are outside the stage in the same x and y position and I just need to tween the x coordinate.

Now I'm working with an external document class where I'm trying to hold all my functions and I'm stucked with the Tweens. I'm willing to stay away from the flash tween engine and I'm trying to work with tweenLite.
 
Is it possible to pass parameters through eventListeners so I can use something like this inside my docClass?
 
public function animeThis (e:MouseEvent, mc:MovieClip, ep:int):void { //ep stands for endPoint.
TweenLite.to(mc, 2, {x:ep});
}
 
If this is possible, how am I supposed to write the listeners so it will pass the event to be listened for AND those parameters? And how to build the function so it will receive those parameters and the event?

View 23 Replies

ActionScript 1/2 :: How To Pass Parameters Between Frame

Nov 24, 2011

I have e buttons, I need pass a parameter between frames, like this: If I chose btn1 gotoframe 10 and the parameter is "pt", can I do this? How?

View 1 Replies

ActionScript 3.0 :: Pass Parameters Through DispatchEvent?

Feb 4, 2012

I've written an imageLoader class. I want to dispatch an event after the completion of image loading to the document class from which imageLoader has been initialized.

[Code]...

onLoaderComplete is the image loading complete event and onLoaderProgress is the image loading progress event. Here i have dispatched an event in inLoaderComplete event. I want to send parameters along with the dispatchEvent. How it can be done?

View 2 Replies

Flash :: Pass Parameters To An .onPress() In AS2?

Apr 4, 2012

I'm trying to do something like this:

var something = "someValue";
some_btn.onPress = function (something) {
someFunction(something);
}

[Code].....

But it traces "undefined". What would be the correct way of achieving this?

View 3 Replies

Flex :: Pass Parameters To A Skin?

Apr 4, 2010

I have 2 skins, almost identical, but differ in 1 small way that can be accounted for if I could pass a Boolean to the skin while assigning it to the host component (a button).

<s:Button skinClass="MyBtnSkin" />

Is there a way while assigning the skin to the button, I could also pass a parameter to the skin somehow?

View 1 Replies

Pass Parameters To Actionscript 2 In Flash?

Jul 13, 2010

I read though this answer for as3, which is not working for as2.What's the most compatible way to handle parameters in flash?

View 1 Replies

Flash :: Pass Parameters To A SWF Launched From The IDE?

Dec 23, 2010

A SWF can access parameters set in HTML via loaderInfo.parameters. How do I set this in a .fla project so that they are set when I run the SWF with ctrl-enter ?

View 1 Replies

ActionScript 3.0 :: Pass Parameters To A Loaded Swf?

Jan 26, 2009

I tried to find an answer here, but haven't.i am loading an AS2 swf inside an AS3 swf.the AS2 file needs some initial properties to get started (used to pass them through the flashVars).in Flex i used the SWFLoader.load() method and passed in the parameters through the url. (url..).since the flex swf output is heavy i would like to use the flash Loader class.is there a way to pass the parameters with the Loader class?or should i use LocalConnection methods to start the process externally?

View 2 Replies

ActionScript 3.0 :: How To Pass Parameters To Loaded Swf

Aug 28, 2010

I have installed DfGallery2 in my server and I would like to load it into my other swf. There's html version generated by the gallery : Quote:

<embed src="Gallery.swf" quality="high"width="500" height="500" FlashVars="xmlUrl=gallery/api/rest/get_gallery/1/json" allowFullScreen="true" type="application/x-shockwave-flash" />

What I want is to load Gallery.swf into Main.swf and see all the images. So how do I pass FlashVars from Main.swf to Gallery.swf?

View 5 Replies

ActionScript 2.0 :: Pass Parameters By Reference?

Oct 30, 2006

How can I pass parameters by reference? So it doesn't make a copy out of it, but modifies whatever I pass in? This:

function ChangeString(string:String)
{
string = "inside string";[code].....

outputs "outside string", since functions seem to take objects by value. get multiple variables out of functions? Returning a custom class?

View 5 Replies

ActionScript 3.0 :: How To Pass Parameters To Function

May 12, 2009

I have a hard time getting this
Code:
var whichXML:String = "category1";
loadFirstTime(whichXML);
function loadFirstTime(whichXML:String):void {
XMLLoader = new URLLoader();
XMLLoader.load(new URLRequest(whichXML + ".xml"));
}

View 1 Replies

ActionScript 3.0 :: Pass Parameters To The Eventhandler

Jul 8, 2009

Is there any way to shorten this code by passing parameters to the eventhandler through the addeventlistener? For example, this is the code:

[Code]...

Basically, just pass the params to the handler through the listener... I hope there is, this is getting tedious...

View 3 Replies

ActionScript 3.0 :: Pass Parameters To Functions?

Jul 19, 2009

Pass additional parameters to this type of functions?[code]...

View 1 Replies

ActionScript 3.0 :: Pass Parameters From Parent To Child Swf?

Sep 8, 2009

I have made a piece of flash that runs on an xml document and now I need to pass a flash variable (via the html swfobject) to the flash to dictate this xml location. The variable is successfully passed if I embed the main swf straight into the swfobject.The problem is I am using a preloader swf to load the main swf onto the page and I can't seem to work out how to pass the variable (from swfobject) from the preloader to the main swf.

View 3 Replies

ActionScript 3.0 :: Pass Parameters To Event Handlers?

Jul 23, 2011

My project has a target object (center of stage) and a moveable object, which is created each time a user presses "Enter". Each movable object is identified as part of an array (i.e., object[i]), and a new line (i.e., line[i]) is dynamically drawn from the center of the newly created object to the center target object.

Basically, as the object is dragged around the screen the line is to stay connected to the target object. Therefore, that specific line for that object being moved must be redrawn using a drawLine function inside the event handler. My issue is how to get line[i] to be identified within the even handler? (Using AS3 coding)

[Code]...

View 1 Replies

Flex :: Pass Parameters Across Multiple Applications?

Jul 21, 2009

Is there any way we can pass parameters from one flex application to the other flex application ?

I know we can pass parameters from module to application and vice versa.

View 1 Replies

Flex :: Pass Parameters To HTTPService And Use Them Inside The URL?

Aug 2, 2009

Flex3 + Cairngorm. I have my service in Servicis.mxml:

<mx:HTTPService id="docIndex" url="{URL_PREFIX}/jobs/{???}/docs" resultFormat="e4x"/>

And I call it from my generic restful delegate like this:

public function index(params:Object):void {
var call:AsyncToken = services.getHTTPService(resourceName+"Index").send(params);
call.addResponder(responder);
}

I want to know how I can use the params Object I pass inside the url definition (the ??? above).

EDIT: I'll explain myself if you didn't understand my problem: I have a restful api written in rails to which I'm connecting. Doc is a child resource of Job. If I want to get all docs I have to supply a job_id too. Therefore in the service the url must be changed for each .send() call, with the proper job_id (the ??? part above). I'd like to call it like myDelegate.index({job_id:34}) and insert that job_id field in the Service URL.

View 1 Replies







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