-
Problem with button linking to external SWF file.
Okay, Im sort of new at flash so dont judge if I start tossing wrong statements or something. Anyhow, heres the problem. Me and some pals are making a game for school in flash.
My friends have completed the game itself and its up to me to fix the menu. So this is the problem, when I simply open the game SWF file the game works just fine. But when I open it from my menu, the following problem appears:
TypeError: Error #1009: Can not access a property or method of a null object reference.
at SpriteSheet()[C:\Users\nti\Desktop\copy58\SpriteSheet.as:34]
at racing()[C:\Users\nti\Desktop\copy58\racing.as:45]
It says that the problem is supposed to be in the games as files, but it doesnt occur when I simply open the games swf.
Heres the code I used for the button in menu linking to the game:
btnGame.addEventListener(MouseEvent.CLICK, start)
function start(Event: MouseEvent){
var newMedia:Loader = new Loader();
var cont:MovieClip = new MovieClip();
newMedia.load(new URLRequest("racing.swf"));
cont.x = 400;
stage.addChild(cont);
cont.addChild(newMedia);
}
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
|