onClipEvent(enterFrame){
if(_root.reBox,_root._xmouse,_root._ymouse){
if(_root.reBox._width - 5 > 50){
_root.reBox._width -= 5
//you can change the speed using that variable
}
}
i haven’t tested it but it might work – oh and btw check out the hitTest function, much better than rollOut or rollOver or anything…
Thanks for helping me out guys, I really appreciate it and will show yall what I using the script for a little later on today.
mlkdesign : hitTest. Yeah ive heard of it, will have a look later, thanks.
Voetsjoeba : It works great thanks, but I have no idea how! I probably sound sooooo stupid, but am a little confused on “tarW”.
thoriphes : Perfect! Plus I understand how it works…hurray!
Just one more question though. Looking at the examples posted up by Voetsjoeba and thoriphes…which one is coded best. I dont want to start an argument, its just I hear so much about clean coding that I wanted to know which version is better coded.
Well, obviously since you understand Thors code and mine not, thors is better coded Both of ours have their advantages. Thors keeps the button, but constantly changes _root.onEnterFrame. Mine doesn’t, but I changed the button to a movieclip. Although movieclips can be used as buttons. It’s up to you.
By the way, thors runs way smoother on my pc than mine. Is that just me or do you experience the same ? Note to self: set standard framerate higher. End note
Oh, and tarW stands for targetWidth. It indicates the width that the box should ease to. The essential code is on the box itself.
*thoriphes ? did I just say thoriphes ? wasn’t it ithuriel ? --checks-- yeah, thoriphes. What happened to ithuriel ?
actually, it ran smoother because i uped the frame rate. you had it set to the default 12. most animations look best when the frame rate is higher than 24.
I didn’t change the behavior of reBox, because i didn’t know what you still wanted to do with it, so i went with giving _root an onEnterFrame. between voets’ and my code, they’re pretty much the same. as for cleanliness, voets is better. If you notice, I assign an onEnterFrame function for each button event, which really isn’t clean, in my opinion. I would’ve gone with changing a variable and sticking with a constant onEnterFrame similar to what voets did.