Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

877042 Posts in 32843 Topics- by 24285 Members - Latest Member: Nicketas

May 18, 2013, 11:31:17 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Learning to program in Flash (title changed for obvius (or not) reason)
Pages: 1 [2]
Print
Author Topic: Learning to program in Flash (title changed for obvius (or not) reason)  (Read 2554 times)
davidp
Level 6
*



View Profile WWW
« Reply #15 on: November 04, 2009, 08:24:04 AM »

y, i noticed. mah, i've just put shooting on shift for testing purposes.
Logged

Drew
Level 0
***


Hooray


View Profile
« Reply #16 on: November 04, 2009, 09:35:55 AM »

There's a menu option in the flash player (when run from the IDE) called "disable keyboard shortcuts."
Logged
davidp
Level 6
*



View Profile WWW
« Reply #17 on: November 07, 2009, 06:26:20 AM »

thanks for the hint drew.


hm, now i have basic movement and player control engine down and i'm wondering how to work with "view" (if such thing even exists in ac3). what i want to do is like have movieclip of a let's say, 800x800 and want a view of 400x400 follow my character. could anyone point me in some direction?

i was googling for views in ac3 but found nothing of a relevance.
Logged

YagerX
Level 2
**



View Profile WWW Email
« Reply #18 on: November 08, 2009, 01:44:24 PM »

Are you saying that you want to zoom/scale everything up or do you want to only use a section of the screen?
Logged

davidp
Level 6
*



View Profile WWW
« Reply #19 on: November 08, 2009, 01:54:19 PM »

no, i want would like to follow player's character where he goes. like so:

so player moves around movie clip and view follows him. its like i have 800x800 movie clip, but the flash screen is only 400x400 and follows player around when moving on mc.
« Last Edit: November 08, 2009, 01:57:58 PM by davidp » Logged

bateleur
Level 10
*****



View Profile
« Reply #20 on: November 08, 2009, 11:36:52 PM »

You do that in one of two ways:

1) The easy case is where your Flash application is the size you want for the view. In this case, simply set the MovieClip as a child of the root DisplayObject and use its x and y properties to position the MovieClip once per frame via the frame event for any of the DisplayObjects involved.

2) The slightly trickier case is where the view you want is smaller than the Flash application. In this case you need to create a separate DisplayObject to use for the root, add the MovieClip as a child as before, but also add a second child to use as a mask, then set the mask property of the view DisplayObject appropriately. (And don't forget to set the visibility of the mask object to false, or it will be rendered, which isn't what you want.)
Logged

Glaiel-Gamer
Moderator
Level 10
******


Stoleurface!


View Profile WWW Email
« Reply #21 on: November 09, 2009, 12:09:20 AM »

if you mean "camera" then there's no built in camera class or functionality in flash (a weird overlook considering it started off as an animation program, a number of people have made animation tools or libraries for camera's, but it's easy enough to implement that it's not worth it to try and learn a library)

make sure you don't add children to the root or stage and instead add them all in one clip (I usually call it "game").

store your camera values (camx, camy, camrotation, camscalex, camscaley)
then you can make a matrix

var m:Matrix = new Matrix;
m.scale(1/camscalex, 1/camscaley)
m.rotate(-camr);
m.translate(-x, -y);

game.transformMatrix = m;



transformMatrix might not be the right property name, look it up on the livedocs to be sure
also i might have the matrix transformations backwards

livedocs:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/
learn to love that site
Logged

YagerX
Level 2
**



View Profile WWW Email
« Reply #22 on: November 09, 2009, 12:34:23 AM »

You could cover the excess area with what I assume to be your gui? Although for performance reasons, you might want to check whether certain objects are within view or not and then remove them from the display list.
Logged

davidp
Level 6
*



View Profile WWW
« Reply #23 on: November 09, 2009, 03:17:20 AM »

ok guys, thanks for the suggestions and reply, gonna check the livedocs link and stuff mentioned. appreciate it.
Logged

Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic