ccbeneke
02-25-2009, 04:10 PM
Could someone please help me with my actionscript 3.0 code?
I am creating a flash website and have follow the instructions in my book to a t, but they won't work. Only the home file loads. The menu will not navigate to different states in its timeline, nor will it load anything other than the home file.
I keep getting this message:
1119: Access of possibly undefined property myLoader through a reference with static type flash.display:DisplayObjectContainer.
I have this code in scene 1:
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("MAPC09_home.swf"));
addChild(myLoader)
Then on my menu I have:
function buttonClick(event:MouseEvent):void
{
gotoAndStop(event.target.name);
home.enabled = true;
exhi.enabled = true;
conf.enabled = true;
jour.enabled = true;
blog.enabled = true;
memp.enabled = true;
link.enabled = true;
cont.enabled = true;
abou.enabled = true;
memb.enabled = true;
event.target.enabled = true;
this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
home.addEventListener(MouseEvent.CLICK, buttonClick);
exhi.addEventListener(MouseEvent.CLICK, buttonClick);
conf.addEventListener(MouseEvent.CLICK, buttonClick);
jour.addEventListener(MouseEvent.CLICK, buttonClick);
blog.addEventListener(MouseEvent.CLICK, buttonClick);
memp.addEventListener(MouseEvent.CLICK, buttonClick);
link.addEventListener(MouseEvent.CLICK, buttonClick);
cont.addEventListener(MouseEvent.CLICK, buttonClick);
abou.addEventListener(MouseEvent.CLICK, buttonClick);
memb.addEventListener(MouseEvent.CLICK, buttonClick);
Any ideas how I could edit this so that my code will allow the menu to navigate me to different pages?
I'd really appreciate any help. I am losing my mind!
I am creating a flash website and have follow the instructions in my book to a t, but they won't work. Only the home file loads. The menu will not navigate to different states in its timeline, nor will it load anything other than the home file.
I keep getting this message:
1119: Access of possibly undefined property myLoader through a reference with static type flash.display:DisplayObjectContainer.
I have this code in scene 1:
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("MAPC09_home.swf"));
addChild(myLoader)
Then on my menu I have:
function buttonClick(event:MouseEvent):void
{
gotoAndStop(event.target.name);
home.enabled = true;
exhi.enabled = true;
conf.enabled = true;
jour.enabled = true;
blog.enabled = true;
memp.enabled = true;
link.enabled = true;
cont.enabled = true;
abou.enabled = true;
memb.enabled = true;
event.target.enabled = true;
this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
home.addEventListener(MouseEvent.CLICK, buttonClick);
exhi.addEventListener(MouseEvent.CLICK, buttonClick);
conf.addEventListener(MouseEvent.CLICK, buttonClick);
jour.addEventListener(MouseEvent.CLICK, buttonClick);
blog.addEventListener(MouseEvent.CLICK, buttonClick);
memp.addEventListener(MouseEvent.CLICK, buttonClick);
link.addEventListener(MouseEvent.CLICK, buttonClick);
cont.addEventListener(MouseEvent.CLICK, buttonClick);
abou.addEventListener(MouseEvent.CLICK, buttonClick);
memb.addEventListener(MouseEvent.CLICK, buttonClick);
Any ideas how I could edit this so that my code will allow the menu to navigate me to different pages?
I'd really appreciate any help. I am losing my mind!