actionscript

Talk / ask questions about Macromedia Flash and related software.

Moderators: HeRetiK, The inner Core

cepticmind
latency
latency
Posts: 2
Joined: Sat Apr 16, 2005 2:08 am

actionscript

Postby cepticmind » Sat Apr 16, 2005 4:09 pm

How could I make it so that when the mouse arrow goes over an object it drags with it? I don't want to have to press on it to drag.

User avatar
ardizt
Captain Evil Stomper
Posts: 4906
Joined: Tue Jun 08, 2004 1:45 pm
Location: Finland

Postby ardizt » Sun Apr 17, 2005 8:57 am

Image

User avatar
HeRetiK
Site Admin
Site Admin
Posts: 7931
Joined: Mon Mar 31, 2003 7:50 pm
Location: yurop
Contact:

Postby HeRetiK » Sun Apr 17, 2005 10:31 am

if you use a button to call the drag script i'd usually look like this:

on(press) {
startDrag("");
}

but since you want it to happen when the mouse rolls over you'll have to use this:

on(rollOver) {
startDrag("");
}

User avatar
Schnabel von Rom
divine
divine
Posts: 2422
Joined: Mon Aug 02, 2004 8:25 pm
Location: Teh town

Postby Schnabel von Rom » Tue May 03, 2005 6:37 pm

I'm trying to learn ActionScript myself, but I don't really understand what the ' and { and } are for. Is there any good answer for that?

User avatar
HeRetiK
Site Admin
Site Admin
Posts: 7931
Joined: Mon Mar 31, 2003 7:50 pm
Location: yurop
Contact:

Postby HeRetiK » Tue May 03, 2005 7:58 pm

on(press) <== event handler

{ <== start actions

code
code
code
code

startDrag("") <== startDrag() is a method, the () are used for parameters like in this case the instance name of a movieclip. the "" indicate an empty string. Which means for the startDrag() method that it refers to the clip it currently is in.

} <== end of action block

User avatar
Schnabel von Rom
divine
divine
Posts: 2422
Joined: Mon Aug 02, 2004 8:25 pm
Location: Teh town

Postby Schnabel von Rom » Tue May 03, 2005 8:48 pm

thanks...now I understand much better...


Return to “Flash”

Who is online

Users browsing this forum: No registered users and 1 guest