Just downloaded the interactive image panning fla and am using the code to move swatches that are buttons…
it works only problem is that once a button is clicked it still pans the buttons around as it is a onMouseMove function.This can confuse the user as they may think it has not been clicked.So what i want is for that panning to stop once one of the panning buttons is clicked.yet still have that panning function if the original button clicked is the wrong one and the user wants to scroll through them again.
If anyone know even what they think they would do or have a link of similar app pls let me know
What function happens when the button is clicked? How does the user determine if they’ve clicked the wrong button? Cna’t really offer suggestions without more data.
For similar projects, my scrolling buttons would load images when clicked. The button click would also trip a boolean which deactivates the scrolling function. When the user finished looking at the image, they would click a “close” button that would unload the image and reactivate the scrolling action.
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = _xmouse/Stage.width;
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}
target.destX = Math.round(-((target._width-Stage.width)mSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else if (target._x>target.destX) {
target._x -= Math.ceil((target._x-target.destX)(speed/100));
} else if (target._x<target.destX) {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
};
}[/COLOR]
So i replaced the img that panned with a movie clip that contains my bottons(these buttons are chioces of fabrics). when one of the panning buttons is pressed it gives a variable “choice:String” a value,ie brown fabric,blue fabric
i had a possible solution in the following but it doesnt work.Dont know if its just error in the syntax or what
i had a possible solution in the following but it doesnt work.Dont know if its just error in the syntax or what
Well, if you look at the tutorial code, you’ll notice that it also creates the onEnterFrame handler, and that is actually what moves the image around. You would need code like:
ok where would that code go …on the button release event?
This is the code so far in the panning buttons
on (release) {
_root.choice = "Choice 1";//e.g."Choice 2" on the second panning button
_root.bagchoice.text = "Choice 1";// a label showing what selection they have made
}
Well, I don’t really know the position of your buttons relative to the image pan MovieClip, but I’m guessing that something like this would work:
on (release) {
_root.choice = "Choice 1";//e.g."Choice 2" on the second panning button
_root.bagchoice.text = "Choice 1";// a label showing what selection they have made
_root.my_mc.onEnterFrame = null;
}
is a mouse move so it intiaites practicly always.?dont know still new to AS but how i understand it is that the above function is the one that Starts the whole thing.so thats where it posiibly needs to be stoped.yes? no?
Thanks for the help again guys.
>greylensman : that would be great thanks.think i may reconsider the pan on mouse move to when a button is pressed,but would love to sort this out for future