PDA

View Full Version : progress bar help.. just getting one error.


Raine
08-18-2009, 06:44 PM
Hi all. I'm using the progress bar and uiloader component in flasch cs3 to try and preload an external swf into my larger movie. I've been having trouble with this for such a long time I have to be close but when I test my movie I get the error

"1120: Access of undefined property request." with the source as "uiLoader.load(request);

this is the coding I have in my actions panel :

var imageURL:String = "portfolio.swf";

var imageURLRequest = new URLRequest(imageURL)

uiLoader.scaleContent = true;
uiLoader.load(request);

progressBar.source = uiLoader;
progressBar.addEventListener(ProgressEvent.PROGRES S, progressHandler);
progressBar.addEventListener(Event.COMPLETE, completeHandler);

function progressHandler (event:ProgressEvent):void{

status_txt.text = int(event.currentTarget.percentComplete) + "%";

}

function completeHandler (event:Event): void {

progressBar.removeEventListener(ProgressEvent.PROG RESS, progressHandler);
progressBar.removeEventListener(Event.COMPLETE, completeHandler);
removeChild(progressBar);
status_txt.text = "";

}

if anyone can point out what I'm doing wrong I would be so thankful!

CyanBlue
08-18-2009, 07:03 PM
Howdy and Welcome... :)

This line...
uiLoader.load(request);
probably should be this???
uiLoader.load(imageURLRequest);
I moved some of your posts to the Components forum because the title was saying component, and that's the best place for such question, but I guess your question does not really have much to do with the component... Maybe you should name the thread better next time... ;)

Raine
08-18-2009, 09:12 PM
Thank you so much! That was it. The preloader is working! My swf is just loading distorted now. I thought that problem was taken care of by setting it to "true"?

Thank you so much!!

CyanBlue
08-18-2009, 09:45 PM
I don't know what you meant by 'true' bit, but the error message was saying that 'request' is not defined, but you were trying to use it... So, I was looking at your code, and I wasn't finding 'request', but found 'imageURLRequest' that probably was used the same reason...

Raine
08-19-2009, 12:39 AM
Thanks Cyane. I got that problem worked out I'm just on to a new one and I'm not explaining it well. You were right on with what was wrong with my code though!

CyanBlue
08-19-2009, 03:24 AM
Glad to help... It's CyanBlue... ;)