Jump to content
Search Community

any simple loader demos out there?

timaging test
Moderator Tag

Recommended Posts

Hi,

 

I downloaded the source files and that stuff is WAY out of my league. Is there anything that shows just how to load an external mp3 file and the swf that I'm publishing?

 

I have some code that worked fine for a while but is now broken on the file I'm working on. I have no idea how to troubleshoot it, but I think maybe part of it is because I'm calling an external mp3 file?

 

import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;


stop();
var loader:SelfLoader = new SelfLoader(this, {onProgress:progressHandler, onComplete:completeHandler});
function progressHandler(event:LoaderEvent):void {
   progressBar.scaleX = event.target.progress;
   myTextField.text = int( loader.progress * 100 ) + "%";
}

function completeHandler(event:LoaderEvent):void {
 this.gotoAndPlay("3")
}

 

thanks-

Dave

Link to comment
Share on other sites

ok, I'll check this out. I think this is the one I've been using all along, and now ironically doesn't work with this file I'm using now.

 

this is what I have:

 

import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;


var loader:SelfLoader = new SelfLoader(this, {onProgress:progressHandler, onComplete:completeHandler});
function progressHandler(event:LoaderEvent):void {
   progressBar.scaleX = event.target.progress;
   myTextField.text = int( loader.progress * 100 ) + "%";
}

function completeHandler(event:LoaderEvent):void {
 this.gotoAndPlay("3")
}

stop();

 

 

and this is what I'm getting now... just a white screen, then it flashes on real quick. I've duplicated and used this exact code on at least 8 presentations too.... now all of a sudden it doesn't want to work:

 

http://www.taylorimaging.com/clientArea/eoi_statement

Link to comment
Share on other sites

just to elaborate on this-the only difference I see is that usually I put the sound on a frame in the timeline, and have it as an event sound. In this file, I'm calling the sound from the timeline, but that's in frame 3, using that code from yesterday which now stops and starts everything perfectly.

 

Dave

Link to comment
Share on other sites

the code is the same as above, but with the trace in it"

 

import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;


var loader:SelfLoader = new SelfLoader(this, {onProgress:progressHandler, onComplete:completeHandler});
function progressHandler(event:LoaderEvent):void {
   progressBar.scaleX = event.target.progress;
   myTextField.text = int( loader.progress * 100 ) + "%";
}


function completeHandler(event:LoaderEvent):void {



  trace("traced");

//  this.gotoAndPlay("3")
}

stop();

 

 

this has worked flawlessly for several projects. the only difference between this one and the other ones is that I'm calling the sound from the library. All my other projects have included the sound in a frame on the timeline, and set to event. I can't even understand why that would make a difference. I have Carl's code in there, and if I remove the loader it works fine.

 

Dave

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