basic actionscript help
- Started
- Last post
- 5 Responses
- airey
any help on this one? i've done a scrolling dynamic text box and have the following code on the up and down buttons (obviously the '+' and '-' symbols are used for each):
--------------------------------
on (press) {
scroller.scroll += 1;
}
--------------------------------how can i make this a loop and set it to 'rollOver' rather than 'press' so the user just hovers their mouse over to make it scroll? (obviously 'rollOver' only works the once as it is now).
thx and apologies for being a simpleton...
- toastie0
make it set a boolean variable to true when it's rolled over and set it to false when it's rolled out, then on enter frame on the textbox movie, if the variable is set to true, then scroll, if false, don't. to make a global variable accessible from any movie clip you can make an invisible movie clip that holds global variables.
- airey0
right. thanks for the reply, unfortunately i think the question made it obvious that i don't actually know much. what i don't know includes how to write a boolean loop. anyone help out with a script at all?
- ozhanlion0
read hitTest() on the reference dictionary.
- mikotondria20
in the button in the MC:
on(rollOver){
thething = 'true';
}
on(rollOut){
thething = 'false';
}the MC's onenter:
onClipEvent(enterFrame){
if(thething){
whatever += 1;
}
}I reckon.
- function820
in frame one
assuming your button name is 'up'
up.onRollOver = function(){
this.onEnterFrame = function(){
scroller.scroll+1
}
}up.onRollOut = function(){
delete this.onEnterFrame
}i use a similar script to scroll movieclips with 2 simple buttons and it works great