TheGrayK
That Awesome Guy You Know
Senior Member
  
Offline
Gender: 
Posts: 902
Daredevil Extraordinair!
|
 |
« on: August 30, 2009, 08:19:18 PM » |
|
Thanks I think I was Just about to make that discover I just hadn't looked at the code yet I made an extra frame at the beginning to set up for this though. Thanks for the help man it is much appreciated. Edit: Ok so I did all of the frame adjustments but know something strange is happening here is the code and the swf so you can see for your self test.gotoAndStop(1);
home.addEventListener(MouseEvent.MOUSE_UP, homeclick); function homeclick(event:MouseEvent):void{ var request = new URLRequest("http://toonani.webs.com/"); navigateToURL(request,"_self"); }
about.addEventListener(MouseEvent.MOUSE_UP, aboutclick); function aboutclick(event:MouseEvent):void{ var request = new URLRequest("http://www.toonani.webs.com/about.htm"); navigateToURL(request,"_self"); }
contact.addEventListener(MouseEvent.MOUSE_UP, contactclick); function contactclick(event:MouseEvent):void{ var request = new URLRequest("http://www.toonani.webs.com/con
|
|
|
|
« Last Edit: October 12, 2009, 05:13:36 PM by TheGrayK »
|
Logged
|
The novelty of my own mortality has yet to be torn, While the vulgarity of my existence has made its welcome worn.
|
|
|
|
adzy-2k6
|
 |
« Reply #1 on: August 31, 2009, 09:23:55 AM » |
|
I can't remember the specific code, but all you need to do is use the code to hide the normal cursor, and then set the image you want to replace it with at the current co-ordinates of the cursor.After that, its as simple as updating the location. There is no code as far as i know that changes the cursor itself, you need to do it manually.
|
|
|
|
|
Logged
|
|
|
|
TheGrayK
That Awesome Guy You Know
Senior Member
  
Offline
Gender: 
Posts: 902
Daredevil Extraordinair!
|
 |
« Reply #2 on: August 31, 2009, 06:47:37 PM » |
|
Thanks  the first thing you are talking about that is what im trying to do but effin actionscript is so hard
|
|
|
|
|
Logged
|
The novelty of my own mortality has yet to be torn, While the vulgarity of my existence has made its welcome worn.
|
|
|
Jaehl
Mobal Gloderator
Global Moderator
Veteran
 
Offline
Gender: 
Posts: 1417
/* No comment */
|
 |
« Reply #3 on: September 01, 2009, 09:27:21 AM » |
|
I can't remember the specific code, but all you need to do is use the code to hide the normal cursor, and then set the image you want to replace it with at the current co-ordinates of the cursor.After that, its as simple as updating the location.
It's even easier than that; you just need one line to hide the cursor and one to move the image around. Mouse.hide(); someMovieClip.startDrag(true);
|
|
|
|
|
Logged
|
|
|
|
|
adzy-2k6
|
 |
« Reply #4 on: September 01, 2009, 09:39:24 AM » |
|
You also need to create the movie clip and place it on the stage. Still, your way is a lot easier once that is done (and he can probably get away with declaring it as a sprite, providing the cursor only has one frame).
|
|
|
|
|
Logged
|
|
|
|
TheGrayK
That Awesome Guy You Know
Senior Member
  
Offline
Gender: 
Posts: 902
Daredevil Extraordinair!
|
 |
« Reply #5 on: September 01, 2009, 10:09:05 AM » |
|
It's even easier than that; you just need one line to hide the cursor and one to move the image around. Mouse.hide(); someMovieClip.startDrag(true); Thanks! there is so much syntax that i dont know Can anyone tell me if there is a better looking way to do that first part?
|
|
|
|
|
Logged
|
The novelty of my own mortality has yet to be torn, While the vulgarity of my existence has made its welcome worn.
|
|
|
Jaehl
Mobal Gloderator
Global Moderator
Veteran
 
Offline
Gender: 
Posts: 1417
/* No comment */
|
 |
« Reply #6 on: September 01, 2009, 10:19:07 AM » |
|
Can anyone tell me if there is a better looking way to do that first part?
Nope, that's about as short as it gets. 
|
|
|
|
|
Logged
|
|
|
|
TheGrayK
That Awesome Guy You Know
Senior Member
  
Offline
Gender: 
Posts: 902
Daredevil Extraordinair!
|
 |
« Reply #7 on: September 01, 2009, 11:10:30 AM » |
|
Dang oh well thanks for that actionscript it worked perfectly You also need to create the movie clip and place it on the stage. Still, your way is a lot easier once that is done (and he can probably get away with declaring it as a sprite, providing the cursor only has one frame).
does this mean i cant animate it? if it does why not? EDIT: I tested it and animating it works so you were talking about something else 2 questions what would be the benefits of declaring it a sprite? and why wouldn't i be able to animate it if i did?
|
|
|
|
|
Logged
|
The novelty of my own mortality has yet to be torn, While the vulgarity of my existence has made its welcome worn.
|
|
|
|
adzy-2k6
|
 |
« Reply #8 on: September 01, 2009, 11:16:42 AM » |
|
A spirite is basically a one frame movie clip :/. If you intend more than one frame, you can just declare it as a movie clip. On second thoughts, just call it a MovieClip. That will allow you to add animation if you wish, without having to go and change the coding 
|
|
|
|
|
Logged
|
|
|
|
TheGrayK
That Awesome Guy You Know
Senior Member
  
Offline
Gender: 
Posts: 902
Daredevil Extraordinair!
|
 |
« Reply #9 on: September 02, 2009, 01:46:04 AM » |
|
Thank you adzy that was very helpful I appreciate all of the help from you guys if i have anymore questions i will post them in this thread
|
|
|
|
|
Logged
|
The novelty of my own mortality has yet to be torn, While the vulgarity of my existence has made its welcome worn.
|
|
|
supermoose
Full Member
 
Offline
Gender: 
Posts: 240
Yes. I beat IWBTG. Only took ~60 hours of play.
|
 |
« Reply #10 on: September 03, 2009, 10:36:58 AM » |
|
[Edited by the moose for readability] There are actually benefits to using a sprite. A sprite is much less memory intensive than a 1 frame movie clip. A movie clip has to animate. i.e. It starts, hits its end, and restarts its cycle every time you enter a frame. A sprite loads its one frame and displays. The main difference being the sprite doesn't try to loop and calculate the next frame, it knows it only has one. This is useful if you are planning on putting many different movie clips inside of another, as that is often a good way of organizing yourself. Many tutorials (Actionscript Gaming University for example) tell you to spawn all of your enemies inside of a master "gameLevel" MovieClip. Now, your computer loads up the frame for the gameLevel, and then has to calculate all of your enemies next frames as well, leading to compounding, or nesting, calculations. A sprite has very few calculations associated with it, eliminating one level of the nesting calculations. Mainly they are an organizational thing with very low overhead. Compounding movie clips can be costly.
Also, in response to your earlier mouse question, startDrag sets the registration point (the black plus sign) over the tip of the mouse, if you want to center the movieclip or put a different corner over the edge, you would need an event listener for ENTER_FRAME where clip.x = mouse.x
|
|
|
|
« Last Edit: September 04, 2009, 03:25:58 PM by supermoose »
|
Logged
|
|
|
|
|
adzy-2k6
|
 |
« Reply #11 on: September 04, 2009, 09:27:45 AM » |
|
Does that mean sprites can have multiple frames, but you have to define which it should show ?. I always assumed that it was just a sinlge frame movie clip :/
|
|
|
|
|
Logged
|
|
|
|
Jaehl
Mobal Gloderator
Global Moderator
Veteran
 
Offline
Gender: 
Posts: 1417
/* No comment */
|
 |
« Reply #12 on: September 04, 2009, 09:42:35 AM » |
|
A sprite is basically a movie clip with no timeline, so it just has the one frame.
|
|
|
|
|
Logged
|
|
|
|
TheGrayK
That Awesome Guy You Know
Senior Member
  
Offline
Gender: 
Posts: 902
Daredevil Extraordinair!
|
 |
« Reply #13 on: September 04, 2009, 12:47:14 PM » |
|
So to clear some confusion A sprite is a graphic that does not have frames therefore no animation?
|
|
|
|
|
Logged
|
The novelty of my own mortality has yet to be torn, While the vulgarity of my existence has made its welcome worn.
|
|
|
supermoose
Full Member
 
Offline
Gender: 
Posts: 240
Yes. I beat IWBTG. Only took ~60 hours of play.
|
 |
« Reply #14 on: September 04, 2009, 03:16:59 PM » |
|
right, the sprite only has one frame. There is no "animating" it, only displaying the single frame. This saves a lot of background calculations, and frees up resources. Sorry If I was unclear.
|
|
|
|
|
Logged
|
|
|
|
|
Brackenwood
|
|
|
|
|
|
Logged
|
|
|
|
|