header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Rob
Points:0
Posts:0

2/21/2011 6:57:25 PM

Title: Sniper Game for Touch Screens


Hi,

I hope someone can answer this for me.

Basically I'm creating a sniper game for the iPhone 4 using AS3 in Flash CS5. I want to be able to control the scope using my finger on the iPhone so I can see the red dot without my fingering covering the red dot. Is there code to offset the drag so I can see the red dot in the centre of the scope so when I move it with my finger, I should be able to see the red dot.

Any help would be much appreciated.

Cheers guys.



1
Andrid
Points: 720
Posts:0
2/22/2011 7:17:41 AM



its quite simple. You just need to create your cross movieclip in such way that its center point is below the red dot by around 30 pixels x and y.

When you drag the object by snapping its center to mouse. Your object is placed exactly below mouse. So you need to draw the object in minus co-ordinates. Let me know if its not clear

2
Kevin
Points: 0
Posts:0
2/22/2011 7:21:10 AM



double click your cross movieclip to enter inside it . Now shift the cross drawing upwards by some distance. Compile and see if now its visible when dragging or move it more.

3
Rob
Points: 0
Posts:0
2/22/2011 7:45:43 AM



I actually tried that before. I thought they would be another way to actually pan the scope around. Its just with that method, when you click to shoot, the mouse/touch goes back to where I moved the cross and then goes back to the normal position. I have to code it in a way that when I have the red dot over something, it shoots it.

I'll just have to work with that method. Thanks the help guys.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 5+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions