Jump to content


_root function


  • You cannot reply to this topic
3 replies to this topic

#1 Cyrus_Zei

    Young Padawan

  • Members
  • Pip
  • 13 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Web design. grapic, 3d gaming, life?

Posted 18 January 2007 - 07:28 AM

First of all, i have read all the other posts, and i have done EXAKT as they do but it just won't do it, what am i doing wrong
*cry*

it's like this this i have an movieClip, and inside this movie clip, i have an button, and oh yeah i am using flash 8,

iwant the button that is in the movieClip to go "up one level" and go to the _root timeline, but it just won't do it :wacko: :bashhead: :)

this is the code that i use inside the movieClip

[indent]on(release){
_root.help.gotoAndPlay(315);
}[/indent]

really need to know it really fast!

thx for the help

========EDIT==========
flash really are strange i got to say that, i cahnged the 315 frame to 1 and then it just worked :S

Edited by Cyrus_Zei, 18 January 2007 - 07:35 AM.


#2 Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 18 January 2007 - 08:26 AM

Hm it's quite difficult to see what's causing the problem if we don't know what "help" is (even though it's probably a Movieclip, I would still like to see the .fla)

#3 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 18 January 2007 - 08:54 AM

Make sure you have a frame 315. Another option is to make a new layer inside help, give a keyframe where you want your button to gotoAndPlay, and give it a frame label. To give a label, you click on the keyframe and in your properties panel, right where you would give a movieclip its instance name, you can enter the label for the frame. Then inside your button you can use:

_root.help.gotoAndPlay("labelName");

replace labelName with whatever you use for your label. keep the quotes, if you dont use the quotes, it will look for labelName to be a string/number variable, and as a result, it will return undefined.

Using frame labels is generally a better way to do gotoAndPlays, because if you change animations or number of frames, the location of the frame you wish to play might have changed. Makes life easier, less debuging or hunting for that one line of code thats breaking everything...

#4 neutron

    Young Padawan

  • Members
  • Pip
  • 12 posts
  • Gender:Male
  • Interests:flash, photography, travel, games

Posted 31 January 2007 - 07:36 PM

I totally agree with pax on labeling key frames. It is good practise.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users