PDA

View Full Version : points on a picture



chris9902
June 7th, 2003, 04:50 PM
sorry about the topic but i could not think of anyhting to call it.

i need help, i have a picuter that is in mask (so it is not all visible) but i want it so when i press a button it goes to part of the picture of moves the picture so it is visible in the mask.

anyone think then can help.:-\

EXAMPLE: think you are looking down at a map but not all is visble, you press a button and the map move to be visble.:sigh:

Voetsjoeba
June 8th, 2003, 01:32 AM
So when a button is pressed the whole map gets visible ? Then you'll just have to ease the mask out of sight I guess.

chris9902
June 8th, 2003, 02:02 PM
no the mask stays the same just the part of the map you can see changes

Voetsjoeba
June 8th, 2003, 02:47 PM
Ahh I see. Add this code to a new mc on the stage.


onClipEvent(enterFrame){
_root.maskedobject._x = _root.tarX-(_root.tarX - _root.maskedobject._x)/1.2;
_root.maskedobject._y = _root.tarY-(_root.tarY - _root.maskedobject._y)/1.2;
}


And add this to the button:


on (release){
_root.tarX = targetXposition;
_root.tarY = targetYposition;
}


You'll have to replace targetXposition and targetYposition with the X and Y value of the masked object when at the place where it should move to.

I can't test it tho cuz I ain't got Flash on this pc.

chris9902
June 8th, 2003, 05:24 PM
thanks i will test it later:)