Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-12-2008, 02:31 PM   PM User | #1
coffeebeans
New to the CF scene

 
Join Date: May 2008
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
coffeebeans is an unknown quantity at this point
Error 1119 When Trying to Load Movie Clips

Kind of a newbie, so bear with me, please. I'm setting up a minisite and have a navigation menu (functioning as a movie clip) that's meant to launch other movie clips. Code on the parent file:

Code:
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("main.swf"));
addChild(myLoader);
Code on the child movie clip:

Code:
stop();

function buttonClick(event:MouseEvent):void
{
    gotoAndStop(event.target.name);
    
    tyes.enabled = true;
    winterpassing.enabled = true;
    otherwork.enabled = true;
    author.enabled = true;
    
    event.target.enabled = true;
    this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
}

tyes.addEventListener(MouseEvent.CLICK, buttonClick);
winterpassing.addEventListener(MouseEvent.CLICK, buttonClick);
otherwork.addEventListener(MouseEvent.CLICK, buttonClick);
author.addEventListener(MouseEvent.CLICK, buttonClick);
I've yanked this practically straight out of a book and have no idea why I keep getting this error message:

Quote:
1119: Access of possibly undefined property myLoader through a reference with static type flash.display:DisplayObjectContainer.
this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
Any ideas? Let me know if you need clarification...not sure I explained this too well.
coffeebeans is offline   Reply With Quote
Old 05-12-2008, 03:13 PM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
This thread deals with a UILoader but I think you are having a similar issue.
http://www.codingforums.com/showthread.php?t=138242
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Users who have thanked _Aerospace_Eng_ for this post:
coffeebeans (05-12-2008)
Old 05-12-2008, 03:46 PM   PM User | #3
coffeebeans
New to the CF scene

 
Join Date: May 2008
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
coffeebeans is an unknown quantity at this point
Thank you! That did the trick. Changed one line from

Code:
this.parent.myLoader.load(new URLRequest(event.target.name + ".swf"));
to

Code:
(root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));
Unfortunately, a new problem came up. Whenever I click on a button in the navigation, none of my other SWFs are showing up and I end up with this error message:

Quote:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at rapp_fla::mcMenu_1/buttonClick()
All of my SWFs are in the same directory as the parent SWF, are named correctly, and all work perfectly on their own, but just won't load within the main SWF.
coffeebeans is offline   Reply With Quote
Old 05-12-2008, 03:48 PM   PM User | #4
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
trace this and see what you get
PHP Code:
trace(event.target.name ".swf"); 
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-12-2008, 03:56 PM   PM User | #5
coffeebeans
New to the CF scene

 
Join Date: May 2008
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
coffeebeans is an unknown quantity at this point
Ack, sorry, haven't been working in Flash for too long (as if that weren't obvious already). Where am I supposed to add or replace the trace line? I've tried a few different spots and haven't been able to figure it out.
coffeebeans is offline   Reply With Quote
Old 05-12-2008, 07:01 PM   PM User | #6
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Code:
function buttonClick(event:MouseEvent):void
{
    gotoAndStop(event.target.name);
    
    tyes.enabled = true;
    winterpassing.enabled = true;
    otherwork.enabled = true;
    author.enabled = true;
    
    event.target.enabled = true;
trace(event.target.name + ".swf");
    (root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));
}
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 02-25-2009, 11:05 PM   PM User | #7
ccbeneke
New to the CF scene

 
Join Date: Feb 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
ccbeneke is an unknown quantity at this point
Did you ever get this fixed? I am having the same problem. I think we used the same book. Any help?
ccbeneke is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:02 AM.


Advertisement
Log in to turn off these ads.