ActionScript 3.0 :: External Swf File Loaded By Preloader: Place And Size?
Feb 22, 2011
i try to implement a preloader for my site but i have the following problems:once the preloader is finished it opens my external swf but this one appears below the preloader and very little in the window (almost smaller than my preloader size)
I have a flash file (a flash navigation bar actually, which gets loaded in all the webpages inside the website). What I am trying to do is place an external swf file on it in a desired position when the corresponding page is being loaded. I am using FlashVars (variable name -> 'movieName') to pass the name of the movie clips. These variables are read by the navigation swf file and the corresponding swf file should be loaded in the area specified. Now, to create a container, I am using createEmptyMovieClip() method which will host all the external swf files.
The swf files are all being loaded but with a lot of problems. First, no matter what I try, the swf file comes at a fixed place (which is way off from where it is supposed to be). I have tried checking if the container loaded the movie before fixing its position but it changed nothing. Although it did change the position of a weird background colour box I am getting when the movie starts loading - which brings me to the second problem.
A rectangular box flashes once when the external swf is loaded, and its position is being affected by whatever I am setting the _x & _y values of the container movies to. I have no idea why it is happening as it doesn't happen when I test that swf seperately.
I have been looking for a way to show a preloader before the external SWF file loaded but unfortunately I had no luck as of yet!!I have a button that loads a few external files in some empty MCs. I just want to show a small preloader before the external SWF files loaded?
I have a Flex application that loads some data from the database. During this I want my custom preloader stay visible. When I postpone the dispatchEvent( new Event(Event.COMPLETE)) in the FlexEvent.INIT_COMPLETE handler, the loading will never happen because the next frame is not entered. How can I keep the loader running until all the data is fully loaded?
I have a preloader.swf that loads another swf (main.swf). It all works fine, however I would like the loading bar to stay on 100 (once it gets there) for 2-3 seconds before the main.swf opens, currently as expected from the code below, as soon as it gets to 100% it flicks straight over to the main.swf.
I am using tweener, and I could achieve this easily using the onComplete code to call this.addChild(loader);, however, the problem is, both my preloader and my main swf are liquid layouts, and if I were to call the this.addChild(loader); at the end in its own function, then it throws a
TypeError: Error #1009: Cannot access a property or method of a null object reference.
. The only way to get around this error is to put the this.addChild(loader); so that it loads upfront. After a bit of google research, i found this error occurs due to the stage properties already been set in the preloader.swf (from liquid layout)then once the main.swf loads it tries to set them again...So is there another way i can cause a delay for 2-3 seconds once my preloader hits 100?
Below is my preloader code with liquid layout settings
1. using my tweener onComplete method and fixing the error caused by preexisting stage properties
2. Thinking of an alternate way to delay the main.swf from opening straight away (keeping in mind that this.addChild(loader); would need to stay where it is...
PS - here is a link to a person who was getting the #1009 error with preloader and liquid layout, their solution works, but won't allow me to use a tweener delay...[URL]
I made a preloader for my single scene movie and although the preloader is about 16k, when placed into frame 1 of the movie and tested, the frame is shown to have about 256k, which is larger than the movie it's loading. I've gone through all the files and made sure that export in frame 1 is not checked and made sure the publish settings also are set to export in frame 1.
I have a main index SWF that preloads an external video SWF... when i test it offline it works fine..when i test it online it doesnt work fine... Weird observation: Online it worked when the external swf was only 10-20 kb But when i tried with bigger file size about 3.5 mb (which is the actual video i want to load), it doesnt work.... on the preloader it says NAN%... Now...could anybody try to explain to me what the hell is going on? I am attaching the Flash files in CS4 and CS3 format...
I have tried everything i know to get this to work but nothing has. I am trying to place external file by calling the url into my movie. It works but I cannot position it. I have tried using mc but when i do that the file will not load. my script is below whith the url.
//load Movie Behavior if(this == Number(this)){ loadMovieNum("http://void.snocap.com/s/T3-31324-KUSPN325KQ-S/",this);
How to preload this: I've made buttons which loads external txt files into textBox (HTML render); Those txt files contains text and pictures, like <img src="..."> (HTML tags); Also, there are some links like <a href="asfunction:...> I've made preloader and it displays bytes total for txt files only. Is it possible to make preloader which will calculate the size of a txt file, and the size of image from image tags inside that txt file?
I have my main movie, and from there an external movie is loaded which has a scrollpane on it. Problem is the preloader will not show when the external swf is loaded...when the button is clicked, nothing happens for about 3 seconds and then eventually the scrollpane comes up. I have the preloader on Scene 2, and it works for all my other external swfs so I know its the scrollpane issue.[code]I have tried have the "export to first" frame linkage thing but that doesnt work... does anyone know how best to do this?
If you load an external swf and after it is totally loaded give it as to change size properties. the file jumps from his size exactly to the pretended.
If you load an external swf and after it is totally loaded give it as to change size properties. the file jumps from his size exactly to the pretended. How do one give code to do this in a progressive way.
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 have followed the tutorial on gotoandlearn that builds a preloader swf to load an external swf. The problem I am having on the main timeline is that I now cannot access a function in the final external loaded swf. This worked fine when I just loaded the external swf into the main timeline but with the preloader I think I have my loader instances confused and I don't know how to fix it.
[Code]...
Like I said this worked perfectly before I tried cleaning things up with intermediate preloader swf and now its all gone pete tong (again!!) When testing this by reviewing the main timeline it cannot recognise the function killStream
this is my final bug then I can finally launch this bloody site. here's my problem, I am loading an external .swf, which contains a pre-loader. the preloader in the external .swf works fine when I test it online by itself (not being loaded via main.swf) But when I test the external.swf through the main.swf the preloader does not work. the external.swf just plays through like it does not recognize the stop in the first frame to initialize the preloader skipping it altogether.here is my code:
I'm creating a flash 3d website for a company. The idea is that there is one overall swf file - this holds the navigation and design. Once the user clicks on a button, it goes to frame 10, I have included the following script to load a swf file
the preloader works, but instead of going to frame 2 of that swf file, it goes to frame 2 of the overall swf that holds the navigation. Does anyone know how to get around this so that it goes to frame 2 in the same swf file as the preloader?
I have a FLash project with a preloader, but the preloader doesnt appear until 70% of the file has loaded, which is useless of course... is there anyway of loading up and displaying the Movie Clip contaning the main graphic Preloader so it doesnt appear too late?
how to retrieve information about size (in pixels) of loaded FLV file? Video object returns 2 pairs of parameters (width,height) which are useless because returns always parameters passed in constructor of Video() object. Another pair is (videoWidth,videoHeight) which is always (0,0). I gave up...
I need this information to scale proportionally video clip to size of area designed to display this video.
I have successfully loaded an external swf file into my own one. now what i want is to change the size of the loaded file.
the loaded file is an image and its height:500 and width:500 but what i want is to resize it to 200x200
How can i do that.
here is my code to load external image var peelawayimage = _root.createEmptyMovieClip("peelawayimage", 7); var mcImage = new MovieClipLoader(); mcImage.loadClip(_root.video_image, peelawayimage);
I'm creating a movie with heavy animation and audio in Flash CS4. I have a preloader that I purchased from flash den.com and I believe it's pre set to begin the movie when the total file is done loading. But I want the movie to begin when half the total .swf file is loaded. Here is my code on frame 1
So I am having a problem with the flash file at this site: [URL]
Everything is working fine, except for the preloader, which only seems to load after the entire file is 100% loaded, which leaves people who visit the site staring at a black screen for quite some time... The code on the preloader frames is as follows:
frame 1 (which has the background for the preloader/ actual load bar etc} var percent:Number = Math.floor(getBytesLoaded()/ getBytesTotal()*100); textBox.text = percent + "%"; textBox._alpha = 80;
[Code]....
Also, if you want to check out the actual program just click when you get to the main screen and click to create new shape (mouse x and y change opacity and speed respectivly) I'm using actionscript 2
I'm working on a project that requires a swf file to have a built in preloader. In the past, puting a preloader in caused problems, because the preloader, wouldn't load until about 90% of the swf had allready loaded. Is there a way to tell flash to load a particular frame first? Or perhaps stream itself?