Flash Code/Mouse Movement
- Started
- Last post
- 17 Responses
- pushme
Maybe made AS is sloppy but often times my mouse moves to quickly and doesn't produce the rollover effects i've defined in flash. This only happens when in an html doc. If I test from the swf I have no problems. Any ideas on how to fix this? thx.
- function820
have you defined large hit areas? if not you might just be missing the active area.
is there alot of processor intensive things going on when its not working? (alpha fades and animated jpgs for example) if their are it might just not be responding becuase the system is bogged down
is your movie small (in physical size) or is your button close to the edge of the movie? sometimes this can cause undesired results because you're moving the mouse out of the movie area and flash looses focus
- fate0
Here's a secret to good rollovers. Have your rollver onimation, in and out, contained in a regular MC. Then apply the following actions to the MC
this.onEnterFrame=function()[
this.onRollover {
gotoAndPlay("over")
}
this.onRollout {
gotloAndPlay("out"
}
this.onPress {do whatever
}
}That method works so much better because the MC can accurately tell when the mouse is not in the OVER region. work with that, you can add things like onPress {this.disable} and such
- fate0
- function820
fate, that method can cause slowdown if you use it on alot of buttons because you have the system constantly looking at each button to see whats going on.
- pushme0
The buttons are dynamically loaded so I believe the hit area is defined by the size of the clip? I guess its possible that the processing may be the issue. 80% of content is pulled in, positioned with AS.
- function820
if its only happening during the loading process its probably the processor
are the buttons movie instances or button instances, because movie instances will only have a hit area over the visible areas (unless you define a hit area)
- pushme0
Here;s my AS:
- pushme0
There movie instances. But they work fine in the SWF just not when the SWF is embedded in HTML.
- function820
fate, that code is needlessly complex!
this.onPress = function(){
this.enabled = false
this.gotoAndStop("down")
currentSelection.enabled = true
currentSelection.gotoAndStop("up...
currentSelection = this._name
}will achieve the same result, theres even more simple ways to do it, but i dont have it on hand
- function820
do you have the movie online somewhere?
you're getting lag because you're loading the external jpg on rollover, not before hand, if you preload it you wont see the delay
- fate0
function82, where in your code does it control Rollover and Rollout states? That's right, it doesn't
- fate0
and I made a mistake, that original code shouldn't have been onEnterFrame, it should have been onLoad, which wouldn't cause any slowdown.
- function820
enabled = false will disable the button when clicked, is that what you mean?
the fla you posted doesnt use rollover states, it highlights on click.
im just offering an alternate solution to make life easier, no need to be snotty at me ;)
- fate0
Perhaps I linked the wrong FLA, but the code I posted earlier in the thread was for controlling rollover animations man. Your code doesn't do that, it simply toggles between enabled and disabled states.
- pushme0
thx function82...i'll give that a shot & if it doesn't work I'll upload the movie.
- function820
yeah, the fla was just a click enable/disable state thing
- pushme0
All my images are loading on the first frame. This is happening w/ other aspects of my movie that don't involve external images.