Professional Web Applications Themes

a few quick questions .... - Macromedia Flash Actionscript

hi. i was looking through the docs and cant find answers to the following quests, maybe someone can help out : 1) how do i define an optional function parameter [like in some of the build-in functions / object methods] ? 2) how do i define constants ? within my FLA and within class external files ? 3) i know how to link movieclips generated at authoring to external classes [via linkage ...], but how do i link MCs created using the createEmptyMovieClip method to an external class ? any info would be supremely appreciated :)...

  1. #1

    Default a few quick questions ....

    hi. i was looking through the docs and cant find answers to the following quests, maybe someone can help out :
    1) how do i define an optional function parameter [like in some of the build-in functions / object methods] ?
    2) how do i define constants ? within my FLA and within class external files ?
    3) i know how to link movieclips generated at authoring to external classes [via linkage ...], but how do i link MCs created using the createEmptyMovieClip method to an external class ?

    any info would be supremely appreciated :)


    nowB@ webforumsuser@macromedia.com Guest

  2. #2

    Default Re: a few quick questions ....

    To make a function with optional parameters, inside that function, check the arguments array.

    EG:

    function move(clip){

    var x = (arguments[1]==null)? arguments[1] : 0;
    var y = (arguments[2]==null)? arguments[2] : 0;
    // I want the clip to move to (0,0) if the parameters are not provided

    clip._x = x;
    clip._y = y;
    }

    move(_root.mc1, 200,300);
    move(_root.mc1);

    The first call will place the mc1 to (200,300), while the second call places it at (0,0)

    Hope this helps,
    Thex.



    Thex webforumsuser@macromedia.com Guest

  3. #3

    Default Re: a few quick questions ....

    Thex,
    is this something new with mx2004? With mx you would have to put something like this for it to work

    function move(clip, x, y) {
    clip._x = x;
    clip._y = y;
    }
    move(_root.mc1, 200, 300);

    Certified but not by Macromedia!
    myurl
    stwingy webforumsuser@macromedia.com Guest

  4. #4

    Default Re: a few quick questions ....

    hiya thex.
    thx so much for your help. 1 down, 2 more to go :))
    what about the rest of the questions, anyone ?

    stwingy, thex was answering about defining optional functional parameters, not regular parameters ...


    nowB@ webforumsuser@macromedia.com Guest

Similar Threads

  1. Can someone help with some quick questions?
    By andyw288 in forum Macromedia Contribute Connection Administrtion
    Replies: 2
    Last Post: March 1st, 06:26 PM
  2. Several quick questions regarding cf flash components...
    By Nafiganado in forum Coldfusion Flash Integration
    Replies: 4
    Last Post: March 24th, 06:23 AM
  3. Quick Questions
    By Joel Berry in forum Macromedia Freehand
    Replies: 11
    Last Post: May 7th, 07:07 PM
  4. I need some help quick...
    By Dean Fritzel in forum Adobe Illustrator Windows
    Replies: 4
    Last Post: April 16th, 04:22 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139