Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

loader.content["getdata"] - why the square brackets

Participant ,
Mar 25, 2013 Mar 25, 2013

loader.content["getData"](libraryS,dataArray);

Hi, I am trying to understand some code

1. The loader.content returns the root display object - a movie clip (which I am loading into a container mc)

2. The getData is a function within the targeted/loaded movie clip

3. The (libraryS,dataArray) are the parameters of the getData function

So why do we use the sqaure brackets for the function name and the normal brackets for the parameters???

Cheers

TOPICS
ActionScript
480
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Mar 25, 2013 Mar 25, 2013

object["name"] is the same thing as object.name and are quite often interchangeable.

If it compiles you could probably write that like this as well: loader.content.getData(libraryS, dateArray);

If that doesn't compile that's probably why it is done the other way.

Translate
Engaged ,
Mar 25, 2013 Mar 25, 2013

object["name"] is the same thing as object.name and are quite often interchangeable.

If it compiles you could probably write that like this as well: loader.content.getData(libraryS, dateArray);

If that doesn't compile that's probably why it is done the other way.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 25, 2013 Mar 25, 2013
LATEST

Thank you very much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines