Flash Actionscript 3.0 Website Problems

  • tiger_pride
  • Newbie
  • Newbie
  • tiger_pride
  • Posts: 8

Post 3+ Months Ago

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?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

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()?
  • tiger_pride
  • Newbie
  • Newbie
  • tiger_pride
  • Posts: 8

Post 3+ Months Ago

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
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

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?
  • tiger_pride
  • Newbie
  • Newbie
  • tiger_pride
  • Posts: 8

Post 3+ Months Ago

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 9 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.