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

getChildAt and methods

Community Expert ,
Mar 10, 2008 Mar 10, 2008
I know I can manipulate a property via getChildAt, but I can't seem to get a method to work. So for a movie clip: container1.getChildAt(0).x=100; works, but container1.getChildAt(0).gotoAndStop(10); doesn't. Is it possible to get a method to work this way?

TOPICS
ActionScript
424
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
Guest
Mar 10, 2008 Mar 10, 2008
getChildAt returns a DisplayObject, and while DisplayObject has an x property, it does not have a gotoAndStop method, which belongs to the MovieClip class.

So if you know the object returned by getChildAt is a MovieClip, you can cast the result to a MovieClip and use gotoAndStop.
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
Community Expert ,
Mar 10, 2008 Mar 10, 2008
LATEST
Thanks!
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