Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:59 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Move object to cursor action workaround for Flex?
PostPosted: September 20th, 2006, 5:00 pm 
Offline

Joined: May 18th, 2006, 7:08 pm
Posts: 15
Location: Jericho, Vermont, USA
I am working on a maze type game and was hoping to do a Opus pro exe and a Flex publication to cover all platforms. The only issue I am having for the Flex version is the Move object to cursor action is not supported for Flex any ideas for a workaround ?

Any help would be much appreciated.

_________________
Wolf Multimedia Studio
Jericho, Vermont (USA)
OPUS XE 5.5
Windows XP Pro SP2, AMD K6 Ath. 2800 1GB RAM, 20GB HD (Prgms), 200GB HD (Video/audio/data), 20GB (data), Dual Monitors, Sony DVD(+/-) Burner


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 21st, 2006, 2:17 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
This is what I did and it seems to work. Perhaps you can modify to suit your needs.

I put a mouse move trigger on the page. Under this I put a script action. The script contained the following:
Code:
var MousePo=GetMousePosition()
var mouseX = MousePo.x;
var mouseY = MousePo.y;
v1.SetPosition(mouseX,mouseY,.05,false)


The .05 is the time it takes to move the object and the false says don't wait for animation to complete (I believe).

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 22nd, 2006, 3:33 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

Very nice solution!

When I tested it, I made a couple of modifications to bwpatric's code:

To get my test sample to work in Flash runtime, I removed the .05 and "false." However, these may be quite necessary.

I used a ticker trigger set to 0.01 seconds for continuous updating.

So the script I used, based on bwpatric's script, was:

var MousePo=GetMousePosition()
var mouseX = MousePo.x;
var mouseY = MousePo.y;
v1.SetPosition(mouseX,mouseY)

Kind Regards,


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: September 27th, 2006, 5:28 pm 
Offline

Joined: May 18th, 2006, 7:08 pm
Posts: 15
Location: Jericho, Vermont, USA
Have still not got a grasp on the scripting.
I have set up the page script

var MousePo=GetMousePosition()
var mouseX = MousePo.x;
var mouseY = MousePo.y;
v1.SetPosition(mouseX,mouseY)

Now how do I get my object to follow?

_________________
Wolf Multimedia Studio
Jericho, Vermont (USA)
OPUS XE 5.5
Windows XP Pro SP2, AMD K6 Ath. 2800 1GB RAM, 20GB HD (Prgms), 200GB HD (Video/audio/data), 20GB (data), Dual Monitors, Sony DVD(+/-) Burner


Top
 Profile Visit website  
 
 Post subject: Figured it out
PostPosted: September 27th, 2006, 5:36 pm 
Offline

Joined: May 18th, 2006, 7:08 pm
Posts: 15
Location: Jericho, Vermont, USA
Figured it out...was doing too many things at once.

Thanks for the sample.

_________________
Wolf Multimedia Studio
Jericho, Vermont (USA)
OPUS XE 5.5
Windows XP Pro SP2, AMD K6 Ath. 2800 1GB RAM, 20GB HD (Prgms), 200GB HD (Video/audio/data), 20GB (data), Dual Monitors, Sony DVD(+/-) Burner


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group