ActionScript 3.0 :: LoaderInfo/flashvars Not Working?
Feb 25, 2008
i have a file named: 394354.html. In it is the following code:
codebase="http://download.macromedia.com/pub/s...ersion=9,0,0,0" width="900" height="900" id="LoaderExample" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
[Code]...
That is part of the source in the LoaderExample.swf. And all I get is a "Parameter text must be non-null" error. I've alternatively tried the FlashVars method using additional <param> and <object> tags but i get the same error. What is going on with Actionscript 3? is this a bug? What am I doing wrong? Do the 5 or 6 tutorials i've read leave some important detail out ?
View 9 Replies
Similar Posts:
Jun 7, 2011
I have built a music community website, obviously members can sign up for an account, and upload mp3 files to their accounts.Once registration is complete, the php script creates a folder in the members directory on my server with their unique id, then when they go and upload an mp3, it uploads it to their folder and automatically creates a playlist.xml file for the song(s) I have a prebuilt flash mp3 player that I got from developphp.com, his as3 code calls for a static directory for the audio and xml, now since the flash player will live in the root, and the xml and audio will live in the members/$id folders, I am told to use flashvars and loaderinfo.parameters to do what I need, and that is to load the xml and mp3 files into the player for the profile that is being viewed at that moment, so lets look at what I've put into the html object and embed.
lets use profile #7
<param name="movie" value="flplayer.swf?<?php print"$id/playlist.xml" ?>">
<embed src="flplayer.swf?<?php print "$id/playlist.xml" ?>"> (please tell me if I have done this incorrectly)
now if we go to the profile.php?id=7 page, thius is what the page source looks like:
<param name="movie" value="flplayer.swf?7/playlist.xml">
<embed src="flplayer.swf?7/playlist.xml>">
now here is where I am stuck, as I said the flash mp3 player urlLoader and URLRequest, and I have been searching for days to figure out what I am supposed to do to get the player to pick up on the flash vars, here is the top part of the as3 code where it calls for the mp3 and the xml.
stop();
var myFormat:TextFormat = new TextFormat();
myFormat.color = "0xFFFFFF";
list.setRendererStyle("textFormat", myFormat);
[code]....
View 15 Replies
Jul 29, 2010
I continue, I must say I've searched on forum and on google and all the different kind of code didn't work On my actionscript panel, I have this:
import com.greensock.*;import flash.net.URLRequest;
import flash.display.Stage;import flash.display.LoaderInfo;
var sujet_no:String = LoaderInfo(this.root.loaderInfo).parameters["sujet_no"];var timer:String = LoaderInfo(this.root.loaderInfo).parameters["timer"];var back_url:String =
[Code]...
View 7 Replies
Oct 24, 2011
I am changing the flashvars variables v1=value&v2=value ect then after the flash movie runs I am changing the variables externally by javascript, so far so good.when flash first loads it reads the vars correctly.when I try to read them ( after the change ) it keeps reading the old values.[code]everything works except I cannot seem to read the changed FlashVars.
View 1 Replies
Nov 9, 2011
I am which requires few things like;
1. swf should play if client open it at his end (this will be detected by checking a text file which has variable on the local drive say "C") swf should preload if finds flashvars from HTML file on server by user 3. if both of the above conditions dosent work then swf should not play
I have succeeded some what in this. if i run the file without preloader it work fine. but when i add preloader to it something goes wrong.
[Code]...
View 5 Replies
Jan 7, 2011
The class that I am struggling with is not the Document Class. I've had great success grabbing variables using LoaderInfo there when building the page from the start. LoaderInfo works great there, I think I am struggling to understand how to use it with the nested classes.This class, SetBookMark.as, is imported into another class that controls button methods. When the user clicks the exit button, its supposed to set the cookies and close the browser window. I've done a lot of error checking and JavaScript alerts to ensure everything is functioning properly and my classes are pulled in correctly. The code I posted below from the navigation class I have built is just the important part showing that I have called the class, added it to the DisplayList. Everything works great other than where it fails to grab the closeTheWindow variable and what its set to.This is the variable in JavaScript that I am trying to grab using FlashVars and LoaderInfo.
Code:
document.movie.FlashVars = "closeTheWindow=true";
Snippet from navigation class that I pulled together
[code]....
View 2 Replies
Aug 8, 2011
I went through many articles and tutorials and I can't get the FlashVars working.
I'm using the SWFObject to insert the Flash movie into HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
[Code]....
But the aname variable doesn't exists in the Flash. Even if I loop through all the param values, there is nothing. I tried to add the "aname" into query and it's working. But I really want and need to use FlashVars.
The full source is available here: [URL]
View 12 Replies
Jun 10, 2009
I've been searching everywhere and I can't find a solution. I use swfobject and flashvars and whenever I use flashvars the dynamic text color won't change. If I put my variable inside the fla timeline, the text color changesHere is my setRGB code:
Code:
var c:Color = new Color(button4.txt);
c.setRGB(0xffffff);
[code]....
View 5 Replies
Jun 21, 2010
I created a flash menu that highlight the current page button reading a variable coming from HTML. I've set a variable in the OBJECT and EMBED tag using the query string syntax, but I get identical results using flashvars. This menu is working perfectly in firefox, but it doesn't in opera or IE 6. In opera it only works if all buttons are vector objects (?!?!?!?):it doen't work if I import a PNG in the buttons. I've put an IF statement (I already tried to use the SWITCH statement with same results) on the very first frame in the menu movie.
[Code]...
View 4 Replies
Oct 12, 2010
I've followed about 10 different tutorials to access FlashVars including this one ([URL]) and nothing is working for me. Here is my as3 code:
[Code]...
View 7 Replies
Jun 8, 2009
I created a same script of calling my flashvars in actionscript 3. But when I tried to display my flashvar in actionscript 2, its not working. I did the same thing in calling and embedding the swf. But it's displaying undefined..
Here's the block of code...
import flash.external.ExternalInterface;
import flash.events.Event;
var xmlFilePath:String;
try {
var keyStr:String;
[Code] .....
I was just trying to display the value of the flashvar. I tested it in the browser but it's still not working.
View 1 Replies
Feb 5, 2011
I have a flex app that I need to pass FlashVars into. It works great on desktop browsers(chrome, firefox, ie) but for some reason the flashvar is always undefined when i load it on my Android browser(webkit on a droid incredible).
Has anyone successfully passed flashvars into a swf on an Android Device?
View 1 Replies
Feb 10, 2012
I have a problem with flashvars , when I read the url from browser if I have assigned just numbers to Id (my paramter in url) ,everything works fine, but if my id includes character, then it does not work , I don't want to change anything in flash side in mxml files, I want to do it with javascript
here is my code
<script type="text/javascript">
function getQueryVariable(variable)
{
[Code]....
View 1 Replies
Dec 18, 2010
I'm trying to load some data using flashvars but nothing is working.
View 6 Replies
Apr 14, 2010
I am retrieving an flashvars object from JSP file. Like userid = mx.core.Application.application.parameters.userJspid;like this it is retrieving in IE browser. But not in FF (Mozilla), why it's not retrieving is there any code i need to add it for Mozilla specially.
[Code]...
View 2 Replies
Aug 26, 2009
i have a swf and i send parameter to this from html. when i load this swf directly to the html page, i can take paramters by using 'this.root.loaderInfo'However, i load this swf into another swf and i load second swf to the html. by this way, i cant take paramters using 'this.root.loaderInfo'. what should i do for this? what is the root and parent relationship between swfs that one within the other one.
View 1 Replies
Jul 7, 2011
As a part of a class I have been asked to place a preloader in front of my projects. I can't believe how tough this is. I get the best results when I use an URLRequest, but I want to understand the timeline.When I put a working preloader in front of my movie it doesn't start "ticking" until some middle point like 20%, or 70% depending on the file size of the movie. When I trace the bytes.Loaded it doesn't start counting until 700K or so.I have looked at several different preloaders and none seem to work as well as the tutorial. Can someone direct me to an "easy to understand" source that explains the loaderInfo / contentLoaderInfo class?
View 3 Replies
Nov 22, 2011
I'm developing a flash file that that will be uploaded to dozens of websites which I have no control over. I found out that one of them seems to be gzipping the swf, which is causing loaderInfo.bytesTotal to be zero. This screws up the loading animation. I tried a workaround of just testing if bytesTotal is zero, if so simply proceed. That doesn't work because, as expected, not all the necessary data has loaded yet. Alternatively I can put a timed delay of whatever the expected load time is, and hope that it covers all the bases.
Does anyone have any other suggestions? Ideally there's an alternative way to define bytesTotal, but I haven't found one. FYI this is somewhat related to this question: Why loaderInfo.bytesTotal is Zero But I can't do the htaccess suggestion because I don't have control over the other websites, some of which may be on windows servers anyway.
View 2 Replies
Oct 17, 2007
I'm loading an image with Loader class, adding a listener to its LoaderInfo object like this:
ActionScript Code:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
var req:URLRequest = new URLRequest("myUrl.jpg");
loader.load(req);
Then of course I have a function ioErrorHandler. How can I get the url within that error handler?
The IOErrorEvent doesn't have something like a url property, nore does the LoaderInfo has one. Well, I just though of getting my Loader object back within the error handler like this:
ActionScript Code:
function ioErrorHandler(event:Event){
trace(event.target.loader);
}
But well... I get runtime error #2099. The Loader object is not available in ioErrorEvent. Do I really need to parse the url from IOErrorEvent.message?
View 9 Replies
Jun 28, 2008
how to use LoaderInfo.getLoaderInfoByDefinition(obj)??? Docs say it wants a "SWF File Object"... I tried feeding it a loaded movieclip. hoping to get the clips loaderInfo, but it simply returned the loaderInfo for the stage, not the loaded clip...
View 2 Replies
Aug 11, 2009
I need to get the density and units from loaded images, both jpg and png. I am able to get the data, but the bytes do not seem to be where they should, according to [URL]..rchange_Format units, xDensity and yDensity should be proceed one another, but I get an unknown value between units and xDensity. Am I reading the JFIF specs wrong or am I doing somthing wrong with the byteArray? Same with pHYs data in pngs, I can get the data but it's not where I expect it according to
[Code]...
Edit: Forgot to add, I am reading the first 100 bytes of the loaderInfo, picked this number arbitrarily. Any suggestions on a safe length, long enough to ensure I can retrieve the metadata but short enough to keep it quick.
View 3 Replies
Oct 7, 2010
This is my case
1: I have two swf : a.swf n b.swf
2: I can't do any coding on a.swf but I can code on b.swf
3: b.swf loads a.swf
4: a.swf takes some params from html
5: Since b.swf now loads a.swf,how can I set loaderinfo params of a.swf from b.swf?
So is there any way I can set loaderinfo params from loading swf to the loaded swf.
View 3 Replies
Nov 12, 2009
I am using LoaderInfo params in my Flash movie. Is it possible to specify sample flashvars in Flash CS4 during design time for debugging???
View 1 Replies
Mar 27, 2010
I have a problem with Flex module. I want to access url variables by this.loaderInfo.url, i call a function in createionComplete handler of module and sometimes it works and sometimes it doesn't. (Can't access... null). Any suggestions?
This function is called in creationComplete handler of module. And although it throws error window, the alert with url shows and contains url of module.
private function checkModuleUrl():void
{
var url:String = this.loaderInfo.url;
Alert.show(url);
}
View 5 Replies
Dec 4, 2011
I am using flashvars to get some info. When im using LoaderInfo(this.root.loaderInfo).parameters from the main fla frame it works fine but how can I use it from withing a class? Something like this -
[Code]...
I'm getting this error message: Access of possibly undefined property root through a reference with static type. Hope someone could guide me how to overcome this.
View 1 Replies
Nov 25, 2009
I would like to find documentation on the order of events for my_loader.contentLoaderInfo;
specifically: does init ALWAYS fire before complete?
View 5 Replies
Jun 22, 2009
I have a class that loads a handful of external swfs, and a preloader class to handle them all as a single object.I was having some strange problems with the loading process and tried tracing the urls to see which file was bugging. For my surprise, almost all loaderInfo objects reported theirs url as null.With a bit of testing I came to the conclusion that they only report some url when the file is almost completely loaded. The docs say something about "possibly wrong urls" before progress events, but that would be in cases where redirect happen, and everything here is local with simulate download option. Also, "event.target.url" inside the very progress event handler reports null unless the target's loading is almost done. Unfortunately I don't have any piece of code with less than a hundred lines to show. But is there any undocumented behavior, known bug or common coding error that generates such situation?
View 1 Replies
Oct 7, 2010
This is my case1: I have two swf : a.swf n b.swf2: I can't do any coding on a.swf but I can code on b.swf3: b.swf loads a.swf4: a.swf takes some params from html 5: Since b.swf now loads a.swf,how can I set loaderinfo params of a.swf from b.swf?So is there any way I can set loaderinfo params from loading swf to the loaded swf.
View 6 Replies
Apr 12, 2011
I want to get some flashVars parameters, but have a hard time getting them into any variable.
When using the following code :
[Code]....
the values are shown inside the SWF as expected. However, when adding a trace in the for loop, nothing is there.
Why is this, and how should I retrieve the variables?
View 6 Replies
Oct 17, 2011
Flash gives access to query-string parameters via calling loaderInfo.parameters() method.And I couldn't delete the field on the object. IS it possible to delete some fields in the object? how can I do this?
View 1 Replies