PDA

View Full Version : move your body__


cisco
02-26-2004, 07:43 AM
hi i have another question,

i want do something like this;

i have a bit map she have a 1800px in h.
i need do some like move this bitmap when mouse coursor is on the flash movie.

flash movie have a 600px in h.
this bitmap is a 3x flashmovie :)
for example;

this bit map it is a 3 area`s in another colors.
first is a green 0-600px
second is a red 600-1200px
third is a blue ? 1200-1800px

what i need, i need help. :)

i create a mc`s
first is a bitmap_mc - there a put bitmap in x=0 y=0
second is a empty_mc - this is a controller
third is a scroller_mc - in this mc i put a bitmap_mc and empty_mc


in scroller_mc >>> bitmap_mc is in the x=0 y=0
in empty_mc >>instance name ctrl, i need put some action

so, i want some like this;

when i start this film i nned bitmap_mc at position RED (SECOND), when i move cursor in left i want move this bitmap_mc to postion GREEN (first) and if i move cursor in right i need move this on position BLUE (third)


some one know what a code i need ???

thanks

nthpixel
02-26-2004, 08:04 AM
First of all, you don't need to put bitmap_mc and empty_mc into scroller_mc. You don't need scroller_mc at all. But if you're going to do it that way, you need to place scroller_mc at x=0 and y=0 on the main timeline. I don't know if you want the colors to scroll as you move the mouse left and right or if you want a color to just appear when you reach a certain area of the screen. The following code just makes your colors appear and it assumes the width of your movie is 600.

Go into scroller_mc and attach this code to bitmap_mc

onClipEvent(load){
_y = 600;
}


This attach this to empty_mc

onClipEvent(enterFrame){
if(_root._xmouse > 590){
_root.scroller_mc.bitmap_mc._y = 1200;
}
if(_root._xmouse < 10){
_root.scroller_mc.bitmap_mc._y = 0;
}
}


If you want the colors to gradually scroll as you move the mouse, a little more code is needed.

cisco
02-26-2004, 08:11 AM
yes i need gradually scroll

can i ?please on this

nthpixel
02-26-2004, 08:25 AM
Ok let's your movie is 600 pixels wide again.You will need to define a center so on the first frame inside scroller_mc put

var xcenter = 300;

Attach this code to empty_mc.


onClipEvent(enterFrame){
_parent.bitmap_mc._y = ((_root._xmouse - _parent.xcenter) * 2) + 600;
}


That should work.

cisco
02-26-2004, 08:54 AM
THNKS !!!!!!!