ActionScript 3.0 :: Loader Have More Than One File In It?
Nov 23, 2009I am trying to load more than 1 swf into a loader and I was wondering if thats possible.
View 1 RepliesI am trying to load more than 1 swf into a loader and I was wondering if thats possible.
View 1 RepliesMy problem is that I'm trying to write a class to display an image file using a loader. Below is the relevant part of the code.
Code:
public class LoadData extends MovieClip
{
[code].....
I get the RSL error everytime I try to export my .fla file. Is there ANY way I can fix this? I got quite alot textwindows, so I could really need help on making a preloader or find another way of fixing this?...
View 1 Repliesi made a preloader, but apparently, the preloader doesn't put the external files "which are refered to through the XML" into count.as if it only gets the bytes of the flash file, it even finishes before the images are loaded, any ideas whats going on?
Code:
onClipEvent (load) {
total = getBytesTotal();
}
[code]....
what i want is that the pre-loader understands that there are external files to be loaded too, so get their bytes and after you finish, go to and play "start"
I have a flash file with a 200 meg video file in it. I want to run a pre-loader and indicate the file is loading. I have a stop action script built into my first keyframs and on a seperate layer the following action script:
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
[Code]...
I'm using the "load streaming mp3 file" behavior, as seen below.
Code:
on (release) {
//Load Streaming mp3 behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
I need to add a loader of some form to it tho. My plan is to have an MC with 2 frames. One with the word "Loading" in it and the other blank. The idea being, if the track is still loading it goes to the loading frame, otherwise to the blank frame. I've already added
Code:
_parent.mp3Loader.gotoAndStop("on");
To the above, to make the loader active.
I was thinking of having something like the following, to turn the loader off.
Code:
if(tune1.loaded) {
_root.mp3Loader.gotoAndStop("off");
trace("song loaded");
}
but that doesn't work...
The problem here is that I have made a simple loader (by following an online tutorial). Its called loader.swf. Now this works fine for the first main swf. But I want this loader to be called in every time an external swf is loaded.This is how my website works, home.swf is loaded first, called from the complete frame of the loader. Now within home.swf there are three buttons, which load separate external swfs each.For example when you click on about button, it loads about.swf. Now I want to call the loader here, as the swf is heavy, but where do I insert the code and how do I link it to the loader??? I know I may be missing something very basic, but any help will be appreciated.
View 1 RepliesThe SWF loads itself almost entirely before even displaying Frame 1 (the pre-loader). Said pre-loader exists in it's own scene; when this scene is exported on it's own, the file size is 1.6 megs (the full export of all scenes is 1.9 megs). There is VERY little content in the preloader, in fact, a blank first scene exported on it's own is ALSO 1.6 megs. There is, however, a lot of content throughout the rest of the file (music, graphics, font, all embedded at the request of a client).It looks sort of like it's trying to ensure that some arbitrary amount of the resources are present before the first frame loads.
I used to be deep into Flash way back in the CS3 days, but haven't touched it since; the result is I am fairly familiar with AS3 but CS5's new features (many of which seem to replace entirely code-oriented methods with point and click methods) often times make me scratch my head, so you'll have to forgive me if this is the sort of 'five times a week question' y'all are numb to by this point.but I'm still not entirely sure.I've already scraped every last little bit of that awful TLF text stuff from the project, and I've fiddled with the action script settings but haven't had any luck.I'm not exactly sure what code to post here, as little of it seems relevant (after all, the problem appears to be happening before anything I've written runs). Please, though, if there's anything I can do to make this more clear, I'm totally willing to oblige.
I'm making a loader.swf to load a menu.swf file. I'm done this dozens of times the same way and it has worked perfect. But this time...when I load my menu and trace it out, the loader keeps loading and reloading the menu.swf infinitley and I don't know why.
The only thing I've discovered is that my menu.swf file will load just fine IF I delete all of the actionscript from it. If there is even a comment in there the infinite loop starts again.
[Code]...
I have a flash file (.fla) which is created in Adobe Flash CS4.
I want to add pre-loader which is basically a simple .gif image (my company logo). I want when someone run that flash (.swf) file, first for at least 3 seconds my company logo will be displayed and then the rest flash file will execute.
how to add a pre-loader image?
I'm attempting to load an external SWF that's hosted on a site into a local SWF file. The external SWF is in a password-protected directory using htaccess.
Here is the code I'm currently trying to use:
var loaderUrlRequest:URLRequest = new URLRequest("http://www.my-website.com/externalFlashFile.swf");
loaderUrlRequest.requestHeaders.push(new URLRequestHeader("Authorization", "Basic
[Code]....
how can i create pre-loader for video files, because i tried to apply the pre-loader that i use with images, and it load actual and when it loaded appears in output pane that message "Loaded file is an unknown type" !!, and my video doesn't play...
this is my code
Code: Select allstop();
var video:Video = new Video(320, 240);
var nc:NetConnection = new NetConnection();
nc.connect(null);
[Code].....
I have set up an xml thumbnail gallery using some of the great tuts on this site (I'm a designer so this dev stuff tends to get a little confusing). Basic setup is quite simple:
xml holds titles, thumb urls and details set up thumbs as a grid system, so they're loading in as columns, all of which is working great.
I have run into a bit of a brick wall though, and that is how to get the thumbs to sequentially load in, instead of random as they currently are.
Code:
...
function GeneratePortfolio(portfolio_xml) {
var portfolioTitle = portfolio_xml.childNodes[0].attributes.title;
var rootUrl = portfolio_xml.childNodes[0].childNodes[0].attributes.rooturl;
[Code].....
I am loading an external swf file using the following code:
//add close button
var reqButton:URLRequest = new URLRequest(btn_close);
var loader2:Loader = new Loader();
loader2.load(reqButton);
addChild(loader2);
[Code] .....
Once the loader loads my image, and I click on it, nothing is happening. Am I supposed to be adding the EventListener to the loader or something else? How can I detect the height and width of the swf file in the loader?
I'm very new to flash - I'm trying to use a pre-loader that loads an external SWF file. Its working except the percentage in the bar is actually reflecting how much of the entire page is loaded, not how much of just the flash banner is loaded. The result is that the percentage bar is still visible over the top of the flash banner when it begins to play and the percentage bar continues to load until the whole page is loaded.
[Code]...
my page contains a Loader to load the different parts of the site as swf but i also have a little intro, witch ist a .flv file. i knwo i can�t load a .flv file in the loader class so i can put it into a swf an load it this way. the thing ist, after the intro is completed my page should get the info to change
1. a var which will change the proberties of the loader
2. the color of the Header/Footer
3. initialize a little x tweening with the body
is there a way to get the onLoadComplete info out of the swf witch contains the flv file or do i have to change the loader to a flvplayback component and afterwards back to a loader
and if i have to do so - how do i implement the flvplayback component into my .as file -i tried it and i always get the message, that he cant find the class.
I have written an actionscript snippet to POST a XML file to the server side.
//code begin
var secondsUTC:Number = new Date().time;
var dataXML:XML = new XML();
dataXML=
<?xml version="1.0" encoding="utf-8" ?> ;
<login>
<time>{secondsUTC}</time>
[Code] .....
When testing, the progress went well. When the loading process have completed. The server side didn't get any files.
I want my product button to click on it, to load an external sfw into a loader and the text of this external swf too. The text is loading good when i click the swf file on its own, but with the index page not. when i click the product button the loader is loading only the swf file of product but not the text on it. The text is coded to the product swf.This is the code of index Page which i want to load the product page:
stop();
productMenu_btn.onRelease = function(){
myLoader.contentPath = "contents/lingerie/lingerie_page.swf"
}
and this is the code of the product page which is loading on the loader :
stop();
myData = new LoadVars();
myData.onLoad = function(success){
if (success){
[code]....
I am using the Loader object to load an image into my flash file. The problem is that, the image file is being copied over from a server to the local machine by some other software, and my flash file tries the load that image while it is still being copied over. The result is that the file is sometimes corrupted.Sometimes the whole image loads, sometimes only half of it, or just a few pixels.. it varies everytime.
View 4 RepliesI am preloading a .swf file using the Loader class (myLoader) and a ProgressBar (pb). When the progress is complete I would like to press the button (es_btn) to enter the site(make the externatl .swf visible). Currently, what it does is, the external file is loading and starts playing in the background before I press the "enter site" button, before I call addChild(myLoader);. How do I stop the external file from autoplay -ing and make it play only when I press the "enter site" button?
Here is the code:
Select allstop();
import fl.controls.ProgressBar;
import fl.controls.ProgressBarMode;
es_btn.visible = false;
var myRequest:URLRequest = new URLRequest("christianfm.swf");
[Code] .....
Im currently trying to upload an external swf file trough an empty mc. But since in this case i will be changing the swf file at times, i hope i could have an actionscript that detects the end of the external swf file and then gets the command gotoAndPlay(2).
View 2 RepliesI try to load a file over the local network with Loader Class but I get the error "URL Not Found". I use a path like this "file://///myPCnetID/pubilcFolder/pictures/mypic.jpg" which refers to a folder on the same PC I compile and run the Air flash file.
When I copy the adress into the browser the jpg-file ist displayed corretly.
I am developing a Image uploader using Flash 10. I am using Filereference object to browse images and Loader to show the image:
Sample code:
var tempFileRef:FileReference = FileReference(ev.target);
var oLoader:Loader = new Loader();
oLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoad);
oLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
oLoader.loadBytes(tempFileRef.data);
It works fine with .jpg and .gif files but when I browse .bmp or .tiff file, I am getting the error:
Error #2124: Loaded file is an unknown type.
Is there a way to load and display browsed .bmp images from desktop?
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?
[Code]....
I want to tile a pattern across the stage, but I want to load it with loader (png file).I used to do it like that, Tile being bitmap in the library with export name Tile
Code:
var pattern:Sprite = new Sprite();
addChild(pattern);
var g:Graphics = pattern.graphics;
function resizeHandler(event:Event=null):void
[code]....
what do i need to do actually to send this to beginBitmapFill ?
Does flash.display.Loader determine the file by filename or header?
The reason why I ask is that I'm getting an IOError: "Unknown File Type" when loading an swf which has a strange filename (in the form of "filename.randomnumbersandletters.swf").
I am trying to import a SWF file into a custom loader and then treat the loaded SWF file as a MovieClip object. The code for the functionality can be seen below.
public function loadMyMovie(movie:String)
{
var now:Date = new Date();
var rnd:String = "?randomize=" + now.time;
[Code].....
When I do this I get the following error.
"Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip."
I am a bit stuck here for the past few days. I have a SWF running in Security.LOCAL_TRUSTED sandbox. I can load my JPEGs and simple SWFs without any problems
[Code]....
I have two swf files, each one almost with the same classes, the most important one is a Singleton class, each swf does "singleton.getInstance()". The diference is that one swf is like a container and the other one is like a module. So when the container loads the module from an absolute path like loader.load("file://c:/modules/module.swf") or loader.load("[URL]"), two different singletons (same class) are created
But when the container loads from a relative path like loader.load("module.swf") , just one singleton is created (that is what I want) I am just intrigued with this behavior, could someone explain me this? PD: I believe is something related to loaderContext and applicationDomain but It also appears that isn't working right. -Patricio Foieri , Vertigo Labs
The title describes the problem: Loader.load() is firing the INIT event, but in my listener it's reporting loader.content as null. The description for INIT event is "Dispatched by the associated LoaderInfo object when the properties and methods of the loaded SWF file are accessible."I'm loading a lot of JPG images, and 95 percent of the time it works fine; the init listener fires and reports valid loader. content.I absolutely need loader.content available because I need to set the bitmap smoothing property to true.I've tried using Event.COMPLETE and it has the exact same problematic behavior.
View 13 Replies