We are starting a shoot game, and for this let’s replace our mouse pointer with a cross hair to aim at our targets.
A great introduction to movie clip variables, hide method, and assigning location.
Move the mouse over the stage to move the cross hair
CLICK HERE FOR COMPLETE CLASSIC GAMING CARTOON SMART TUTORIAL
HERE IS THE SOURCE CODE!
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
var cursor:MovieClip;
//this creates the movie clip
//we will place on stage
function initializeGame():void {
cursor = new Cursor;
//Note that the class has
//Capital C on the name
//cursor with a small c is the moive clip
// name
addChild(cursor);
//this will place a cursor on stage
cursor.enabled = false;
// this will neutralize the cursor
Mouse.hide();
//This will hide our own mouse (cursor)
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragCursor);
// this functions fires when the mouse moves
// changes the cursor location
}
function dragCursor (event:MouseEvent):void{
cursor.x=this.mouseX;
cursor.y=this.mouseY;
// this will place the cursor on stage according
// to the mouse coordinates
}
initializeGame();
//thanks for watching
// see you on lesson 2







65 Responses to “Video: ActionScript Shoot Game Part 1 Custom Cursor”
Trackbacks/Pingbacks
ab346368@gmail.com…
The info you have offered here is valid and informative. You have apparently done a lot of research on the topic. Thanks for sharing it….
ab346368@gmail.com…
not bad,not bad. i say that it’s useful info!!…
ab346368@gmail.com…
I have seen articles like this before on this subject. You have definitely thought this through to come up with such interesting and unique views….
Find more there:…
[...]Search engine optimization needs a good search engine optimizer plan. Just certainly one of these methods can make a big distinction in your sites position and company your website brings you.[...]…
ab346368@gmail.com…
Back in my college days I seldom read writing this good. You display a lot of knowledge without being intimidating. Your attention to detail is superb. You make clear-cut points on which I can concur….
ab346368@gmail.com…
I have read various articles on this topic, but this one really makes sense to me. Thanks for making this information so interesting and understandable….
ab346368@gmail.com…
Your article is clearly very well-researched and informative. I think your content is useful and valuable information presented in a very unique way. On a scale from 1 to 10 it’s a 10….
ab346368@gmail.com…
Until I read your article, I thought I was well versed on this subject matter. Thank you for giving me more fresh information to add to my knowledge to make me an even better teacher….
ab346368@gmail.com…
This information is unique to me. I really like your points and think you put a new spin on this for readers. I respect your writing style. You’re so perceptive….
Title…
Wow that was strange. I just wrote an extremely long comment but after I clicked send my comment didn’t show up. Grrrr… well I’m not typing all that again. Anyways, just wanted to say fantastic blog!…
Title…
Ugh that was strange. I just wrote an extremely detailed response but after I clicked send my comment didn’t show up. Sigh well I’m not typing all that again. Anyways, just wanted to say great blog!…
Intivar…
thanks for the great post!do you need a Intivar…
Title…
Ugh, I just typed a long comment, but it disappeared when I clicked send. Anyway, I’m not going to retype it again, so I just wanted to say great blog! Better than http://google.com!
…
Title…
Wow, I’m really happy that I clicked on this page, good info here! Better than http://google.com!…
Title…
Wow, I’m so happy that I landed on this page, good info here! Better than http://google.com!…