Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
|
|
Syntax Adjustments |
Page: 1 | Reply |
Dec 20th 2003 | #134285 Report |
Member since: Dec 24th 2001 Posts: 222 |
Ive pretty much been doing sloppy programming in flash for the duration of my use. Ive decided to try and get it right with modularizatoin and what not. Im working on a little game to give to my little sister as a christmas present now and i was wondering is there a special way i should declare constants? or should i just declare them as normal variables? and also when im giving a variable a value is it important that i start it off like: var whatever = whatever; or is ok to just say whatever = whatever; without initializing it as a variable.....i didn't think there was any difference between the two but i was reading something the other day and it appeard to me that the two served completely seperate tasks....as though the second example above was declaring an object or an object class or something crazy like that.......so yeah basically looking for some advice on syntax and declaring what i will us as constants |
Reply with Quote Reply |
Dec 21st 2003 | #134462 Report |
Member since: Apr 25th 2003 Posts: 1977 |
im guessing your using flash 5 or later. yup. Just normal variables. "var" is not needed. Those statements basically say the same thing.....there is no need to initialize the variable as in other scripting languages. Also have you tried dot syntax?? So instead of tell Target (this_mc){ gotoAndPlay(2); } you would write this_mc.gotoAndPlay(2); The second way (dot syntax; using dots between the affected symbol and its properties/methods) is easier and will clean up your code. Also it leaves less chance or forgetting to close a set of brackets (as in a 'tell target' or similar). Thats a cool idea. Glad to see flash being used for a diff. purpose for once. |
Reply with Quote Reply |
Dec 22nd 2003 | #134502 Report |
Member since: Dec 24th 2001 Posts: 222 |
thanks man i appreciate it
|
Reply with Quote Reply |
Page: 1 | Back to top |
Please login or register above to post in this forum |
© Web Media Network Limited. All rights reserved. No part of this website may be reproduced without written permission. Photoshop is a registered trademark of Adobe Inc.. TeamPhotoshop.com is not associated in any way with Adobe, nor is an offical Photoshop website. |