links inside MC which is used as btn

  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

Hello! It's me again :)

I have movieClip, used as rollOver/rollOut button and when I rollover it, there shows a few text links, but I cannot link them (I tried converting the texts to btns and MCs but still doesn't work).

I hope u understand me :wink:



Thanks in advance...
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

ye, i know. You can't trigger the actions in nested movieclips if the parent has onRollOut, onRollOver or onPress events. What you can do is one of the following:
1) make the text links as a separate movieclip triggerd by the rollOver/ rollOut events from your movieClip (i.e.: move them on rollOver or whatever animation you have)
2) remove the onRollOut, onRollOver or onPress from the parent and only let it on the links, and to trigger the rollOut/rollOver using the onMouseMove event i.e.:
Code: [ Select ]
isOver = false;
isRollOver = false;
isRollOut = false;
this.onMouseMove = function ()
{
  isOver = movieClip.hitTest(this._xmouse, this._ymouse, false);
}

this.onEnterFrame = function()
{
    if (!isRollOver && isOver)
    {
      isRollOver = true;
      isRollOut = false;
      // start rollOver actions
    }
    else if (!isRollOut && !isOver)
    {
      isRollOut = true;
      isRollOver = false;
      // start rollout actions
    }
}
  1. isOver = false;
  2. isRollOver = false;
  3. isRollOut = false;
  4. this.onMouseMove = function ()
  5. {
  6.   isOver = movieClip.hitTest(this._xmouse, this._ymouse, false);
  7. }
  8. this.onEnterFrame = function()
  9. {
  10.     if (!isRollOver && isOver)
  11.     {
  12.       isRollOver = true;
  13.       isRollOut = false;
  14.       // start rollOver actions
  15.     }
  16.     else if (!isRollOut && !isOver)
  17.     {
  18.       isRollOut = true;
  19.       isRollOver = false;
  20.       // start rollout actions
  21.     }
  22. }
  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

Can't make it work... I guess I don't understand exactly :) I tried both things... Could u explain the first some more please?

I added my .fla:
http://effect.alpha-force.net/drugo/header.rar



It's kinda funny that u r the only person who gives answers to ppl with flash problems on this forum... I don't know, maby all others just read these stupid questions and laugh?
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

1) you have your movieClip with rollOver / rollOut actions and with the links
2) create a new movieClip (Ctrl + F8 ) and cut and paste all the links from movieClip in the new created one (name the movieclip: links).
3) place the movieclip called links in another layer, above the first movieClip
4) give instance names to these movieclips (panel properties), and name the instance to the first movieClip: rollTrigger and the instance to links: links :D
5) create another layer in the main timeline, name it actions, insert a key frame where both the movies (rollTrigger and links exists), and add this code:

Code: [ Select ]
rollTrigger.onRollOver = function()
{
   // here you copy paste the action that you already have for rollOver
   // and also add code to animate the links,
   // presuming the links movie have an animation which starts from frame 2
   this._parent.links.gotoAndPlay(2);
}

rollTrigger.onRollOut = function()
{
   // here you copy paste the action that you already have for rollOut
   // and also add code to animate the links
   this._parent.links.gotoAndPlay(22); // the frame where is animation for rollOut
}
// now, presuming you have the instances link1, link2 ...
links.link1.onPress = function()
{
  getURL("http://www.google.com");
}
links.link2.onPress = function()
{
  getURL("http://www.google.com");
}
....
  1. rollTrigger.onRollOver = function()
  2. {
  3.    // here you copy paste the action that you already have for rollOver
  4.    // and also add code to animate the links,
  5.    // presuming the links movie have an animation which starts from frame 2
  6.    this._parent.links.gotoAndPlay(2);
  7. }
  8. rollTrigger.onRollOut = function()
  9. {
  10.    // here you copy paste the action that you already have for rollOut
  11.    // and also add code to animate the links
  12.    this._parent.links.gotoAndPlay(22); // the frame where is animation for rollOut
  13. }
  14. // now, presuming you have the instances link1, link2 ...
  15. links.link1.onPress = function()
  16. {
  17.   getURL("http://www.google.com");
  18. }
  19. links.link2.onPress = function()
  20. {
  21.   getURL("http://www.google.com");
  22. }
  23. ....
  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

Hi again! I am getting crazy 'cause it doesn't seem to work... I am doing someting wrong for sure :)

I followed every part of your "tutorial" but still aint working. Maby u could show me an example if u got time and energy?

Soz 4 being a hardass :)
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

it depends ... if you want onRollOver for a button to show the links and then onRollOut on that button to hide them, then you have to go with the 2nd part that i gave the code.
But if you want onRollOver for a button to show the links and when you rollOver another button to hide them, then it's easier. Personally i would opt for this because you dont have all the trouble to test on the mouse movement if you are over the button or not.
PM me an email and i`ll send you a version for each of them.
  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

yeey it works now.. thank you m8 ;)

Post Information

  • Total Posts in this topic: 7 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.