Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Film loop on rollover appears top left of button

Status
Not open for further replies.

Techno101

Technical User
Oct 28, 2005
4
0
0
GB
Hi all
I have some text with a rollover event so an animation is played, but when it plays the film loop for the rollover is not in the same location as the original text, but the top left of it.
Any ideas?
Example:

Button

Animation
Button
 
The problem you're having is caused by your text and Film Loop having different regPoint. The regPoint of text is always point(0, 0), while regPoint of Film Loop is always dead centre of the Film Loop.
I am sorry (although it's not my fault!), but you cannot change the regPoint of either text or Film Loop. Film Loop needs to be updated seriously. It's so outdated. Incidentally I mentioned this recently in a forum where Macromedia person contributes - fingers crossed.

Meanwhile you can do this:
[tt]-- Behaviour script attached to a text Sprite
on mouseEnter me
sprite(me.spriteNum).member = member("Film Loop")
sprite(me.spriteNum).locH = sprite(me.spriteNum).locH + sprite(me.spriteNum).width/2
sprite(me.spriteNum).locV = sprite(me.spriteNum).locV + sprite(me.spriteNum).height/2
end mouseEnter

on mouseLeave me
sprite(me.spriteNum).member = member("text")
sprite(me.spriteNum).locH = sprite(me.spriteNum).locH - sprite(me.spriteNum).width/2
sprite(me.spriteNum).locV = sprite(me.spriteNum).locV - sprite(me.spriteNum).height/2
end mouseLeave
--[/tt]

Hope this works for you. (In practice it's better to store the offset values in properties.)

Kenneth Kawamoto
 
sorry for not replying sooner, but notifications where going to an email i havent been checking regularly :( sorry.
anyway i was using text, but then used the "Convert to bitmap" option, which is where the different regpoint you mention is.
For trial and error i deleted it all, then recreated the original text but as a bitmap using the inbuilt paint program (ctrl+5), and voila! it seems to have solved that problem.

If you don't mind i seem to have another problem.
I've got some text, and when you rollover with mouse it shows a film loop. The film loop was made using 3 sprites (layers in flash?). Im using the following code for rollover actions:

on mouseEnter
set the castnum of sprite 4 to 10
end

on mouseLeave
set the castnum of sprite 4 to 5
end

where sprite 4 is where the text is on the stage.
where cast num 10 is the film loop
where cast num 5 is the original text

basically the on MouseEnter works. but the mouseLeave doesnt, im assuming its because the filmloop was made using more than 1 sprite, but am unsure.


thanks for any replies!!
 
Try:

-- Behaviour attached to the button (sprite(4))
on mouseEnter me
sprite(me.spriteNum).member = member(10)
end

on mouseLeave me
sprite(me.spriteNum).member = member(5)
end
--

Kenneth Kawamoto
 
get an error, says:
sprite(me.?spriteNum)...
variable used before assigned a value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top