Skip to main content
Inspiring
March 25, 2013
Answered

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

  • March 25, 2013
  • 1 reply
  • 521 views

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

This topic has been closed for replies.
Correct answer Nabren

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.

1 reply

Nabren
NabrenCorrect answer
Inspiring
March 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.

Inspiring
March 25, 2013

Thank you very much.