Jump to content
Search Community

Add a circular preloader to an existing swf

vlambeat test
Moderator Tag

Recommended Posts

Thanks Carl,

 

Hello, I just bought the preloader suggested on the link you gave me, which looks great, but now I am having a problem with my swf, because it gets distorted when it finnaly does load the content.

I am using a main swf which loads the rest of the sections on a UILoader in the center, I want preloaders on each new section, so I added your preloader to the section (just one for now to test)... I am puzzled!

Can you help me out please?

this is the site: http://www.fhelguera.com/yoya2/Fotosyntesis%20-%20Final%20Run.html

And the preloader you can find it going to the menu at the bottom left, and pressing Portafolio>Diseño Grafico (it’s in spanish)...

As you can see, the rest of the site looks normal, but the one I used for implementing th preloader is huge and out of proportions.

 

 

When I test the .fla alone, the swf works fine, but when test to load the .swf on the main.swf it gets distorted

 

Thanks!

Link to comment
Share on other sites

So, what would that happen?

 

I just added the preloader to the 1st frame, it's a drag and drop preloader, and the reason I am posting this here is because it's made with greensock platform and it's a suggestion from the site. Is there a way to fix this issue?

 

many thanks

Link to comment
Share on other sites

Hi, I gave you my best guess of what is happening by simply looking at your swf.

If you need more help, please provide a VERY simple set of files that illustrates the issue.

Perhaps just one swf that loads another swf with the preloader you are using. I don't need to see the real files you are using in your site, that would be too complicated and unnecessary.

 

As a quick test, replace the Preloader that you are using with a simple square movieclip and see if a very basic shape also gets distorted. Again, double-check that any objects that contain your preloader or loaded swf do not have their scale adjusted on the stage.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Ok, thanks Carl,

 

I made a test with a simple square movieclip as a preloader and the swf does get distorted.

 

I have prepared the very simple files you mentioned, its a main swf with to buttons, no 1 loads a normal swf which loads ok, No 2 loads the same swf with the preloader included... (I have just added the plug and play preloader on frame No 1 on the .fla) ....and it does get distorted.

 

I don't know how to upload the files though!

 

Can you help me out here please?

 

Thanks a lot Carl!

Link to comment
Share on other sites

I am attaching the 3 files I mentioned before, as you can see, the one with the preloader gets distrorted, even the circular preloader itself looks like an oval. I am using a UILoader component, for loading the external swfs.

 

I have the feeling that the UILoader is the problem, but that's my guess, as you can see, I am new to AS code. Anyway, if you can help me out to find out how to implement a preloader i would appreciate it a lot!

 

Thanks

Test_Files.zip

Link to comment
Share on other sites

You have to de-select the "scale content" option for your UILoader as shown in the image below:

Screen shot 2012-12-04 at 9.05.02 AM.png

 

To load a swf using GreenSock's SWFLoader you could do this:

 

 

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.loading.SWFLoader;
import com.greensock.events.LoaderEvent;
import flash.display.MovieClip;

//create a movie clip to hold your loaded content (or use any pre-existing clip from your library)
var swfHolder:MovieClip = new MovieClip();
swfHolder.x = 100;
swfHolder.y = 100;
addChild(swfHolder);

var swf1:SWFLoader = new SWFLoader("preloader.swf", {container:swfHolder, onComplete:onCompleteHandler});
swf1.load();

function onCompleteHandler(event:LoaderEvent):void{
trace("the swf has loaded"); 
trace(event.target);
}

  • Like 1
Link to comment
Share on other sites

Great, that worked... although I have to go and resize all my swfs because I just got used to work with that "scale content" option selected. Is there an easy way to do that? should I go and resize each .fla?

 

Is the greensock code you are suggesting a way to load swfs without the UILoader?

can I implemet this new code and scale the content to fit the area without distorting the swf?

 

Thanks Carl, what a great and effective forum!!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...