button over movieclip problem

  • kontra
  • Novice
  • Novice
  • kontra
  • Posts: 16
  • Loc: Romania

Post 3+ Months Ago

HI,

it`s like this: i have some little buttons in one layer and in another layer bellow i have a movieclip covering the hole scene witch has an on(rollover) and on(rollout) action. That`s because i want my swf file to lighten up when the mouse cursor is over and to darken when the mouse cursor is out. Everything is ok but when the mouse cursor is in the little buttons area the scene darkens and i want to stay lighted as long as the mouse cursor is over the swf area even it`s over the buttons area. How can i do that?

I hope i explaned this problem well ... :shock:
Thank you
  • 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

yes, yes, you did explained :D
there are 2 ways:
1) create a function called sceneRollOver in which you place the code from on(rollover) and a function called sceneRollOut in which u place the code from on(rollout). Then, within on(rollover) u call the sceneRollOver function, same with on(rollout), call sceneRollOut.
then, on the buttons from the other layer, on(rollover), call the sceneRollOver function. Dont use the sceneRollOut function though.

2)instead of using on(rollover) and on(rollout),
use hitTest and onMouseMove.
so, if (mcCover.hitTest(mcCover._xmouse, mcCover._ymouse, true) -> call sceneRollOver function
else call sceneRollOut function
  • kontra
  • Novice
  • Novice
  • kontra
  • Posts: 16
  • Loc: Romania

Post 3+ Months Ago

thank you but still doesn`t seem to work...

this is how i made it in the first place:

http://www.stud.usv.ro/~radub/kontra/casetofon.html


:shock:
  • kontra
  • Novice
  • Novice
  • kontra
  • Posts: 16
  • Loc: Romania

Post 3+ Months Ago

now i`m trying another thing, and i don`t know if is possible:

Code: [ Select ]
<div id="layer1" onmouseover="function();" style="width:206px; height:55px; position:relative; z-index:1;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="206" height="55" id="casetofon" align="middle">
<param name="movie" value="casetofon.swf">
<param name="menu" value="false">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<param name="swliveconnect" value="true">
<embed src="casetofon.swf" menu="false" quality="high" bgcolor="#000000" width="206" height="55" name="casetofon" swliveconnect="true" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
  1. <div id="layer1" onmouseover="function();" style="width:206px; height:55px; position:relative; z-index:1;">
  2. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="206" height="55" id="casetofon" align="middle">
  3. <param name="movie" value="casetofon.swf">
  4. <param name="menu" value="false">
  5. <param name="quality" value="high">
  6. <param name="bgcolor" value="#000000">
  7. <param name="swliveconnect" value="true">
  8. <embed src="casetofon.swf" menu="false" quality="high" bgcolor="#000000" width="206" height="55" name="casetofon" swliveconnect="true" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>


and i need a javascript function that can "tell" flash this:
Code: [ Select ]
intuneric.gotoAndPlay(2);


and i don`t know how to do it...
any help?
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

i sometimes wonder why people look for complicated ways to solve a problem, when there are so many other ways to do it much more simple and elegant.
sure it works, you just need to adjust your script in order to do so.
i`ll provide you later on this evening an example to see that it works, and using both methods. You can always test onRollOut for the player interface if the mouse coordinates are inside the player interface, and if so, keep it lightened, if not ... dark it.
I dont know what you`re trying to achieve with javascript ... but if you think it suits your needs then be my guest:
flash from js
flash js command
  • kontra
  • Novice
  • Novice
  • kontra
  • Posts: 16
  • Loc: Romania

Post 3+ Months Ago

when you don`t know nothing and u have to learn yourself with no teacher or advice, in another language, having no clue about some things u want to do and just keeping on trying till it works ...or not... u try any solution. And that`s because i don`t wanna give up... :roll:
It`s obvious that actionscript is the best solution and i apreciate your answers very much but i just don`t understand and i can`t make it work well in this case...

Thanks again for trying to help me
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

just as i said .... it works
3 layers ->
bottom layer -> mcDisplay, also with instance name on the properties
layer 2 -> the buttons (mc-s as well) -> bt1, bt2
layer 3 - > actionscript

you`ll see the difference when u`re over bt1 and bt2;
have fun

Code: [ Select ]
mcDisplay._alpha = 30;
mcDisplay.onRollOver = function()
{
    fadeIn = true;
    fadeOut = false;
}

mcDisplay.onRollOut = function()
{
    fadeIn = false;
    fadeOut = true;
}

bt1.onRollOver = function()
{
    this._width = 40;
    fadeIn = true;
    fadeOut = false;    
}
bt1.onRollOut = function()
{
    this._width = 31.3;
}

bt2.onRollOver = function()
{
    this._width = 50;
}
bt2.onRollOut = function()
{
    this._width = 31.3;
}

this.onEnterFrame = function()
{
    if (fadeIn)
    {
        if (mcDisplay._alpha < 100)
            mcDisplay._alpha += 10;
    }
    if (fadeOut)
    {
        if (mcDisplay._alpha > 30)
            mcDisplay._alpha -= 10;
    }
}
stop();
  1. mcDisplay._alpha = 30;
  2. mcDisplay.onRollOver = function()
  3. {
  4.     fadeIn = true;
  5.     fadeOut = false;
  6. }
  7. mcDisplay.onRollOut = function()
  8. {
  9.     fadeIn = false;
  10.     fadeOut = true;
  11. }
  12. bt1.onRollOver = function()
  13. {
  14.     this._width = 40;
  15.     fadeIn = true;
  16.     fadeOut = false;    
  17. }
  18. bt1.onRollOut = function()
  19. {
  20.     this._width = 31.3;
  21. }
  22. bt2.onRollOver = function()
  23. {
  24.     this._width = 50;
  25. }
  26. bt2.onRollOut = function()
  27. {
  28.     this._width = 31.3;
  29. }
  30. this.onEnterFrame = function()
  31. {
  32.     if (fadeIn)
  33.     {
  34.         if (mcDisplay._alpha < 100)
  35.             mcDisplay._alpha += 10;
  36.     }
  37.     if (fadeOut)
  38.     {
  39.         if (mcDisplay._alpha > 30)
  40.             mcDisplay._alpha -= 10;
  41.     }
  42. }
  43. stop();
  • kontra
  • Novice
  • Novice
  • kontra
  • Posts: 16
  • Loc: Romania

Post 3+ Months Ago

:D :D :D i think i love you ! Just kidding, i`m not gay.... anyway, if u ever come in my country call for some beers.....

Thank you very much....
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

hahahahahaha, beware what you wish ... it just may happen. Check out my profile :P
  • kontra
  • Novice
  • Novice
  • kontra
  • Posts: 16
  • Loc: Romania

Post 3+ Months Ago

offtopic:

asa deci... :D :D , tot nu-mi schimb afirmatia cu berile, nu vorbeam aiurea...:))
  • classified
  • Expert
  • Expert
  • User avatar
  • Posts: 540
  • Loc: Bahrain

Post 3+ Months Ago

Yea Betta watch out , hes the Ice Cold one ;)

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 6 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.