A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [CS3] Learning the syntax of flash

  1. #1
    Junior Member
    Join Date
    Aug 2008
    Location
    Sydney, Australia
    Posts
    2

    [CS3] Learning the syntax of flash

    I recently picked up actionscript this afternoon and i can safely say i'm getting the swing of things... Well by that i mean, i've been reading tutorials, being able to copy and paste their coding and understand what they're talking about (i have previous programming experience with a program called Game maker which uses it's own little language called GML). But now i want to be able to learn how to write my own stuff from scratch in fhas. I'm pretty lost where to start. Ok first off i might as well list the things i really need:
    1.) In a couple of the videos i saw, they often made reference to little shortcuts like using "!" instead of false and "&&" etc. Is there a list of them somewhere? I couldn't find it in the helpfile.
    2.) Does some sort of database exist that breifly explains all of the functions? like something along the lines of "command, x, y and z vaules needed in this format" etc. It's a little much to ask but that would be so so so so helpful
    3.) I'd like to learn how to be able to set up arrays and variables. The help file was a failure for this. I guess this ties into the one above.
    4.) How can i know what should and shouldn't be applied to movie clips, buttons and graphics? I havn't been able to work out where each one stands differently when it comes to scripting.

    My apologies if this all sounds like a load of garbage and thanks in advance for any help.

  2. #2

  3. #3
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    1.) they are not really 'shortcuts' but called "operators"

    2.) when your in Flash hit [F1].. and just read everything..or search for something that you have curiosity about. this is the ActionScript Dictionary.. and explains what eash function/property..etc does..and how to use it correctly.. it usually has examples of how to implement it as well.

    3.) Im not sure why the help file for learning how to use Arrays or Variables was no good?

    Arrays are just a group of data, that you can use to store & retrieve from

    example:
    var newArray:Array = new Array("a", "b", "c");
    trace(newArray[0]); //this is will display a
    trace(newArray[1]); //this is will display b
    trace(newArray[2]); //this is will display c

    Array start with an index of 0 (meaing 0 is the first element in the array)

    variable are nothing more (to keep it brief) a shortcut or reference to something.

    example:

    var myAge = 25;
    trace(myAge); //will display 25

    you can then use these references in your code

    trace(myAge + 10); //will display 35

    make sense?

    4.) not sure what your asking...

  4. #4
    Robot Master the--flash's Avatar
    Join Date
    Jul 2005
    Location
    The year 20XX...
    Posts
    132
    For #1, they're sort of shortcuts, aren't they? Because if you write
    Code:
    if (!koolaid)
    it's the same as
    Code:
    if (koolaid == false)
    or, at least, I'm pretty sure, just checked it in Actionscript and it seems to have the same effect.

    For #4, are you asking what functions can be applied to each thing, or what?

  5. #5
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    they are BOTH operators...

    "!" & "==" are both operators..

    == (equality) Tests two expressions for equality.

    ! (logical NOT) Inverts the Boolean value of a variable or expression.

    Im not saying they cant be used to get the same results..but it doesnt really matter as they are BOTH operators.

  6. #6
    Junior Member
    Join Date
    Aug 2008
    Location
    Sydney, Australia
    Posts
    2
    @ sstalder - Awesome website! the guy's go into their examples quite comprehensivly, i'm learning a lot from them
    @ Whispers - I went back and did what you said and it turns out everything was there in the help file, i was just hopeless in terms of finding it lol. Thanks a lot for that, that should keep me settled for a while.
    @ the--flash - yeah, that's basically what i'm asking. What can and can't be applied to each?

    Thanks for the quick replies!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center