This content has been marked as final. Show 6 replies
Could you copy and paste your Lingo script here? Could be just a syntax error but can't tell unless I see your script
Yea a bit more script info would help identify the solution. One note,
its' quite unusual to use a separate mate graphic, if one assigns matte
ink to a sprite than any exterior white space in an irregular shapw
okay. I put two same shape of images one as matte and another as image for the button(under the matte) in the same place so i can use image to cover the button which are black for matte as i want button in unique shape not in rectangle shape.
This Behaviour is set in image(1) (see my first post in this topic for reference)
set the member of sprite "image(2)" to "image(3)"
set the member of Sprite "image(1)" to "image(2)"
I think I understand to problem... when the mouse leave the button, image(1) will be destoryed along with this behaviour therefore how can i reset the image(1) to orginal postition (behind the image(2))
the Matte graphic is complicating things. There's an easier way.
I don't know how much you know about Director, so please don't be offended, I'm going to explain this in the simplest possible terms. Besides, other people might read this for help too, so I'll explain this as thoroughly as possible.
Making a rollover button with a unique (not rectangle) shape
Try something like this:
You need two graphics
your static button image (mouseLeave) is called something like "uniqueShape"
your mouse over image is called something like "uniqueShapeOver"
Place uniqueShape wherever you want it on the stage. Do not place "uniqueShapeOver" on the stage at all. Leave it in the cast.
Open the "Property Inspector" pane for uniqueShape (right click the sprite and choose "properties..")
Within this pane you see a bunch of tabs: sprite, behaviour, member etc. Make sure you're on "Sprite."
Look for the word "Ink" with a pull-down menu next to it
Choose "Matte." (This eliminates the need for your third image)
Attach the following script to the sprite:
I see, I thought that the matte button has to be 1 bit image.... How silly of me. Alway thinking too hard ahead of simplicity
Anyway I did that as what you said it seem have created another problem...
the button simply disappear after mouse leave the button, I tried to look around for solution like changing sprite name and button but nothing happened? is that werid? director ignoring my behaviour??
Check three things:
1. make sure the code is attached to the sprite. If it is attached to the castmember, this is fine, but you have to attach the same code to both images, or at least, make sure the mouseLeave, mouseDown and mouseUP info is attached to the second castmember.
This is because, the script is activated when you roll over, changing object1 into object2; but if there is no script or the wrong script on object2, you'll have trouble like this. Sometimes it's easier to put the script on the sprite instead of the castmember.
2. The mouseLeave me code should change the member name back to the member name of the original sprite.
So, in the above example, you've set a castmember called "uniqueShape" on the stage.
On mouseEnter, the sprite changes to a different cast member called "uniqueShapeOver"
on mouseLeave, the sprite changes BACK to the orignal cast member name, in this case, "uniqueShape," and not to anything else.
3. Make sure there are no other cast members in any cast that have the same name as either image. It could be switching back to a totally different castmember.