ActionScript 3.0 :: Passing A Variable To A Loader From The Preloader Swf
Feb 9, 2009
I have a preloader.swf which loads in media_player.swf which is fine. thats all working I also have the preloader loading in a variable from the webpage using flashvars and thats also fine i have that outputting onto a text box so i can see it but what im trying to do is set the source of a uiloader inside the media_player.swf to the variable that im loading into the preloader.swf.
I have a map of the US acquired from here (called U.S. Map). I am currently generating XML from inside an ActionScript file, and would then like to display this map using my generated XML as the argument. According to this, to do this in html would require the following declaration:world.swf?ata_file=pathname/filename.xmlHow can I replicate this behavior using the Loader from ActionScript? Right now I have:
var ldr:Loader = new Loader(); var url:String = "us/us.swf?data_file=senate.xml"; var urlReq:URLRequest = new URLRequest(url);
I´ve searched this all over the net but no success. I have a .swf loader were you can choose a language and then load the main swf. What I´m trying to do is to pass an variable from this loader.swf to the main.swf.
I have a .swf loader were you can choose a language and then load the main swf. What I�m trying to do is to pass an variable from this loader.swf to the main.swf.
I'm using Loader to get the image data out of a ByteArray. The problem is that I need to store that image data with a name (which is known beforehand) once it's passed to the complete handler. Since the operation is asynchronous, I can't be sure which image of multiple will finish loading first, so it seems I need to pass the information with it somehow... I can't seem to find any properties of Loader that pass any vaguely useful information along.
Any recommendations on how I might accomplish this?
PHP Code: myImages_mc = myGallery_mc.createEmptyMovieClip ("myImages_mc", myGallery_mc.getNextHighestDepth()); var myMCL:MovieClipLoader = new MovieClipLoader(); var myPreloader:Object = new Object();myMCL.addListener(myPreloader); for (var i:Number=0; i<myImagesTotal; i++) { [Code] .....
The problem is everytime I click on the image_mc, it traces "undefined". I need to know the value of "image_mc.main" when I click the image_mc. The "main" variable should be the "i", which is the number of loops. On the loop, it traces correctly, but when I put it on the onRelease function, it traces undefined.
I would like for the website preloader to recognize the random image loader that I have on frame 8 of my siteI have a basic preloader on frames 1 and 2(frame 1)
The preloader I created doesn't transistion to the next frame, it just hangs on the preloader frame at 0%.
stop(); loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader); function updatePreloader (evtObj:ProgressEvent):void{ var percent:Number =
I have a loader which loads on a MouseEvent.Click. It uses this for multiple swfs Actionscript Code: myLoader.load(new URLRequest(event.target.name + ".swf")); How can I add a custom preloader to this?
What's the most efficient way of putting a basic preloader and XML loader together in the same frame?
Like, what works the best in terms of order of operation? Or if used at the same time should the XML loader have the preloader in the Progress portion or at the on complete portion?
I am creating a photo gallery using the loader component, however some of the jpgs are around 240k so I want to add a custom preloader. The issue I am having trouble with is... how do I set up a preloader that I have made to activate when the loader component loads a new jpg via the myLoader.contentPath = "sample.jpg"???
I am using a sliding thumbnail gallery w/ a static main image behind.
Anyone have a tip for settingup a preloader for the loader? Never had much luck making preloader.
I'm hoping to implement a preloader on a main.swf that measures the bytes etc loaded in an external.swf. My two concerns are that 1) this just isn't possible? 2) I can't have multiple preloaders on the main.swf, which I would if I used one for the external .swf. I intend to try and explain this in the best way I can what I have done so far, as I personally feel this is quite a complex task.
Here's the basics: I have an external .swf file, being loaded, using the following Action Script (3), in what I shall call, main.swf:
//---loader--- var swfLoader:Loader = new Loader(); addChild(swfLoader); var swfURL:URLRequest = new URLRequest("nameofswftobeloaded.swf"); swfLoader.load(swfURL); function loadHandler (event:Event){ var thumbsPanel:MovieClip = event.target.content; addChild(thumbsPanel);
This works fine. The Action Script I use after this simply allows me to control the external .swf from the main .swf so isn't necessary.. I finish the loader, with this: "swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);" So, this all works fine. However, as the external .swf contains images, it doesn't load instantly. I therefore need some kind of preloader to show how much of the external .swf is loaded. However, I tried placing this in the external .swf itself and it failed miserably - for some reason it basically didn't preload and the completed phase of the preloader just appeared.
I'm trying to make a navigation system for my website where each nav item is loaded as an external .swf. I was able to get that functionality in place. The problem is I want to add a preloader for these external swfs as well.
The code I'm working with is this:
var loadedSWF:Loader = null; /** * Loads an SWF and adds it to container once complete * @param file The URL to the SWF to load
I'm building a simple flash webpage using as3 in order to get accustomed to it. I've got some code for a preloader which, the end result works fine,but I cannot get the preloader assets to update with the loader data.To put it simply, I cannot get the code to update my text field that would display the percent done text.It only shows at 100 when it should go 1, 2, 3, 4...etc.Also I cannot get the bar_mc (just a simple bar graphic) to scale along with the percent loaded.
Code: function handleLoadProgress(e:ProgressEvent):void { while (percentDone < 100) { totalBytes = loaderInfo.bytesTotal;[code]....
i am truly a newbie in as2, i have test the script in local flash "Test Movie" everything was perfect, however when i try to put the files into my remote server, the getBytesLoaded()return to "0" and getBytesTotal() return to "-1" and the loader componentscaleContent=true function was not working also,until i press "F5" refresh button, then everything back to normal, i dont know what is going wrong with my scripti am using Flash CS3, as2.0 and ie7 and the dimension of my loader is 100x100 px
I have an as3 preloader on the main timeline of my project1.swf It works ok if I test the swf by itself, but when I try to load it into my portfolio file through component loader, the preloader doesn't do anything, it acts as if everything is loaded. What do I need to change to get it to work inside another movie?
I'm working on the following site http:[url]...I'm getting there however the preloader I'm using keeps appearing even when the movie in question has been cached. Is there a preloader solution out there that detects when a movie has been previously loaded so that it won't show the loader bar again. I find it annoying seeing the bar appear unneccessarily all the time.The preloader I'm using is basically this:
onClipEvent (enterFrame) { loading = _parent.getBytesLoaded(); total = _parent.getBytesTotal();[code]....
I have a flash file that has an XML driven menuing system to select and play various FLVs. I want to be able to craft different URLs to open the swf and start playing different FLVs. (The others will be accessible from the menu once the sfw is opened, but I am looking to control what plays on opening, dependent on what link a user click.) Not really sure about the best way to get the selection into the swf.
I have a site that uses an user id that needs to be passed from links with a flash banner. I have it working, but not the way I need it and could use a little assistance.
I'm trying to pass the file name of an image upload PHP script into Flash's UILoader component. So when a user uploads their image, the file name of the file is passed to flash so that the image displays within the Flash UILoader application. Here's the PHP variable I'm trying to pass: $filename= ''; And here's where Flash's UILoader gets it's source (ActionScript 3.0): uiLoader.source = "freshly uploaded file.jpg ($filename)?";
i have the php file transfering the correct data but it is not registering as the variable in swfi have already tested the php file and do Know that it is working correctly I have tested the swf file - no user works but the variable sent for balance is not setting
$select = "SELECT * FROM `auth` WHERE `username` = '$username'"; $result = mysql_query($select) or die(mysql_error()); //how many rows
I am using SWFObject2 and passing in a flashvar to the movie it is loading (preloader.swf). I can retrieve the flashvar in preloader.swf no problem at all.The issue is that I am loading another swf from the preloader.swf (lets call it loaded.swf) and I want to get the variable from preloader.swf into loaded.swf - but for the life of me I just can't work out how to do it.If I try and access the variable from the preloader.swf via loaded.swf I just get compiler errors because the variable I want in preloader.swf doesn't exist in loaded.swf
I've got a question regarding passing a variable from PHP webpage to .swf file placed on that webpage.
Example: Button on a webpage1.php is loading a frame.swf file. Frame.swf is loading test.swf into itself using ActionScript Code: loadMovie("min est.swf", mc);
Button on second webpage2.php is again loading frame.swf file but this time I would like that frame.swf would load test2.swf into itself using ActionScript Code:
I have integrated a swf into another swf. (Actually it is a menu that I have incorporated in my 'main swf'.) When clicking a button in swf no.1 (the menu) I set:
_global.new_value="1" ; _root.Application.newfunction(); -and then in swf no.2:
I'm trying to pass a variable from my main swf to another one that's being loaded in a container in the main swf. What I usually do is create that variable in the main swf and have the loaded swf fetch it but in this instance I need the loaded swf to have it's own root.