PDA

View Full Version : drag and throw?


xaub
09-12-2001, 10:43 AM
Hello Gurus,
Here is my situation:
A movie clip represents a hand on stage,wich is moveable in x position with the left and right arrow key.
There are 8 targets (balls) wich one by one should stick on the hand, when it is over it, and the down key is pressed.
Then ones sticked, you should be able to throw that ball on a target...

I imagine something that it has to do with _x and _y properties of both wich should be continuosly checked wether the hand is above a target or not...

It's hard to explain somehow, therefore i created this little dummy movie here. I hope it makes more clear what i'am trying to achieve...

http://01interactions.net/ego_shooter/problem.htm

Thanks very much for help, i really need it at this time.

Alex

Ricod
09-26-2001, 10:43 AM
ehm ... this will take some scripting. I haven't really looked into it, but I've seen someone do a 'throwable' scrollbar. You could pick it up, drag, release and the bar would continue in the set direction (only x-axis, but with some mod. you could do either or both) It also bounced of the border ... I believe the site was www.ultrashock.com Very nice design if you like the black/white metal thingie ... Check for the interface samples ...

Jesse
09-26-2001, 10:54 AM
there's a drag and throw example by flash guru in the movies section... http://www.actionscripts.org/movies-results.php?searchTerm=throw

xaub
09-27-2001, 03:38 PM
Thanks for help Jesse and Ricod, i've downloadet some of the tutorials.
But still the fundamental difference is that i cannot use the mouse. I use a mc and move it left and right like that.

onClipEvent (load) {
moveSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x -= moveSpeed;
}
}

In the meantime i have the picking up working here. Now only the throw thing doesent work.

why does this not work when blue is rootet to hand???

if (Key.isDown(Key.SPACE)) {
} else if (goblue == 1) {
this.gotoAndPlay(3);
}



Thanks for help
Alex