A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] call one function from one mc to another

Hybrid View

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    how else to pass a variable in mc2 from mc1?

    mc1.somevar = mc2.someothervar;

    if the variable doesn't have a var prefix, ie: if its scope isn't restrained to the function's scope, there shouldn't be a problem. You could also in the 1st MCL's onLoadInit give the mc2 variable a value, or even set it there.

    That said, there cannot be an onLoadInit without a MCL, specially if you are not loading anything a second time around. So i suggest you follow the above solution.

    gparis

  2. #2
    Junior Member
    Join Date
    Oct 2009
    Posts
    13
    Quote Originally Posted by gparis View Post
    how else to pass a variable in mc2 from mc1?

    mc1.somevar = mc2.someothervar;

    if the variable doesn't have a var prefix, ie: if its scope isn't restrained to the function's scope, there shouldn't be a problem. You could also in the 1st MCL's onLoadInit give the mc2 variable a value, or even set it there.

    That said, there cannot be an onLoadInit without a MCL, specially if you are not loading anything a second time around. So i suggest you follow the above solution.

    gparis
    Oh my god... thank you my friend i didn't know this in bold. i have just tried it and it works

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