Jump to content
Search Community

Learning the GS basics

XXNephilim test
Moderator Tag

Recommended Posts

Hi Jack!


Sorry about confusion!


Also, I know this thread is super long but I thought it is better to have one long thread dealing with newbie questions and issues rather than clogging the forums with god knows how many - this way all advanced users can simply ignore it while all GS newbies can hopefully learn something from it :?


Anyway, ignore my previous post since I managed to solve the issue by using 2nd suggestion from your previous post - so, all is good now - many thanks! :)



By testing my Learning The Basics project this morning I accidentally discovered something odd with my simple preloader bar...


Basically, if I test the movie using Simulate Download with very low download speeds, simple preloader bar seams not to be working properly :(


Here is the code I used in the project:


// LoaderMax Self + 2 External SWFs

var queue:LoaderMax = new LoaderMax({onProgress:progressHandler,onComplete:completeHandler});
queue.append( new SelfLoader(this) );

var main1:SWFLoader = new SWFLoader("testloading1.swf",{name:"main1",container:this,width:1000,height:670,scaleMode:"proportionalOutside",crop:true});
var main2:SWFLoader = new SWFLoader("testloading2.swf",{name:"main2",container:this,width:1000,height:670,scaleMode:"proportionalOutside",crop:true});

queue.append( main1 );
queue.append( main2 );

// Simple Preloader Bar - PROBLEM!

function progressHandler(event:LoaderEvent):void
progress_mc.progressBar_mc.scaleX = event.target.progress;
trace("progress: " + event.target.progress);

function completeHandler(event:LoaderEvent):void
progress_mc.visible = false;
trace(event.target + " complete");


What I wish to achieve is very simple! - preloader bar should indicate loading of all 3 parts (self + 2 external SWFs) and when loading is finished preloader bar should disappear and all 3 elements (main swf + 2 external ones) would become visible...


At the moment, either due to my crap code or bug in Flash simulate download, this doesn't quite work as imagined... so I am wondering what have I done wrong (if anything).


I am attaching latest version of the project just in case :)

Link to comment
Share on other sites

When you say "this doesn't quite work as imagined", could you explain? I didn't notice any unexpected behavior when I published your file. There are known bugs with Flash's bandwidth profiler, but I didn't see any pop up here. What is happening (or not happening) differently than you expect?


If you don't want your objects added to the screen until everything is downloaded, then don't set container:this on your SWFLoaders - manually addChild() in your completeHandler instead. The way it works now, your swfs are added to the stage as soon as they load (each one independently).

Link to comment
Share on other sites

Hi Jack - thanks again!


"this doesn't quite work as imagined" is exactly as what you explained, quote: "The way it works now, your swfs are added to the stage as soon as they load (each one independently)."


I want to preload them all beforehand and only when loading of all SWFs is finished I wish to display them on the stage...


So yes, it sounds like your suggestion of adding them manually via addChild() is something I have to play with next! :)


Best of luck to me!

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
This may seem trivial but some of us rookies don't have CS5. It would sure be nice to open the source files for viewing. Would it be possible to get them in CS3? Those with the newer CS versions will be able to see them as well.:roll:


Very good point and sorry for not thinking about this one! :(


I am quite busy right now but I will do my best to re-post the project as lower CS version asap...


Not sure if I can save it as CS3 though - CS4 should be no problem however.

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...