|
-
Preloader in document class
Hi Everyone,
I am making a website where one main swf loads several other swf components into it, and the first step is for the loadbar swf to be loaded in. This is the bit I am having trouble with so far:
Code:
package
{
import flash.display.MovieClip;
import flash.events.*;
import flash.display.Loader;
import flash.net.URLRequest;
public class MainClass extends MovieClip
{
public var loadBar = new Loader();
public function MainClass()
{
loadbar.contentLoaderInfo.addEventListener(Event.COMPLETE, addLoadBar);
loadBar.load(new URLRequest("interface/loadbar.swf"));
}
function addLoadBar(e:Event):void
{
loadBar_mc.addChild(loadBar);
}
}
}
I am getting the following errors:
Location:
MainClass.as, Line 3
Description:
1046: Type was not found or was not a compile-time constant: loadBar.
Source:
import flash.display.MovieClip;
Location:
MainClass.as, Line 13
Description:
1120: Access of undefined property loadbar.
Source:
loadbar.contentLoaderInfo.addEventListener(Event.C OMPLETE, addLoadBar);
Hopefully you can get what I'm trying to do; loadBar_mc is an empty movie clip on the main.fla stage which I am using just to position the loadbar.
I realise the solution is probably very simple but I'm pretty new to this!
Thanks!
-
In MainClass you have "loadbar" where you want "loadBar" - and I'm guessing that the other error is a broken library linkage (probably your loadBar_mc is trying to connect to the LoadBar class???)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|