Flash Actionscript 3.0 Website Problems

  • tiger_pride
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 13, 2008
  • Posts: 8
  • Status: Offline

Post December 10th, 2008, 1:01 pm

I have these buttons I want to link to some pages that are in a movie clip inside my site...I have them labeled with instance names, and I still do not understand why it is not working. I keep receiving an error that reads
"TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::buttons_mc_3/da_btnClick()"

This is a class assignment and my teacher has no clue how to help me, he keeps telling me that I'm wrong over and over without giving me any direction in how to fix the thing I'm "wrong" in and I've become frustrated as has everyone else in the class. I'm in desperate need of help...

Can anyone help me?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 10th, 2008, 1:01 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post December 10th, 2008, 1:10 pm

Are you applying the action script to the buttons? or the timeline? In AS 3 you do not apply action script to Buttons like you used to in AS 2, you apply it to the time line. If you're using event listeners for the button click what's the whole code for your event listeners and your btnClick()?
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • tiger_pride
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 13, 2008
  • Posts: 8
  • Status: Offline

Post December 10th, 2008, 1:13 pm

yes, i'm applying the script to an actions layer on the timeline, and this is my code...

--------------------

stop();

function homebtnClick(event:MouseEvent):void
{
MovieClip(parent).page.gotoAndPlay("home");
}
home_btn.addEventListener(MouseEvent.CLICK, homebtnClick);

function fav_btnClick(event:MouseEvent):void
{
MovieClip(parent).page.gotoAndPlay("favorite");
}
fav_btn.addEventListener(MouseEvent.CLICK, fav_btnClick);

function da_btnClick(event:MouseEvent):void
{
MovieClip(parent).page.gotoAndPlay("da");
}
da_btn.addEventListener(MouseEvent.CLICK, da_btnClick);


-------
the same error occurs for every button that i click that has a function
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post December 10th, 2008, 6:44 pm

Well your event listener looks OK assuming the instance name in the first example you posted is da_btn (as an example)

Not quite following exactly what you are doing in your function though.

MovieClip(parent).page.gotoAndPlay("da");

I'll assume that you are going to go to a label "da" but can you explain where that label is in relation to your button?
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • tiger_pride
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 13, 2008
  • Posts: 8
  • Status: Offline

Post December 11th, 2008, 2:29 pm

yes, da is a label...

my buttons are a movie clip, then if you go inside that movie clip, there is a shape tween before they finally turn into the actual buttons...
my text box is also a movie clip, in the first timeline as the buttons, if you enter that movie clip, it runs a shape tween and then turns into another movie clip, which contains the content for my site...which hold the four labels for the different pages...

the only thing that i can possibly think of is that the jumping in and out of movie clips is causing the parent code to mess up...

do you think that could be what is causing the problem?

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 81 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.