Skip to main content
July 13, 2010
Question

Help in AS3 Sprite

  • July 13, 2010
  • 1 reply
  • 746 views

Hello All,

I got this Error : 1061: Call to a possibly undefined method addChild through a reference with static type Class.

what I'm trying to do :

I have create a new class called Graph and make it extends Sprite and  add a scroolpane to my stage and make an empty movie clip called content_mc and make the source of the scrollpane equals to content_mc

in the first frame i wrote this code

import Graph;

var graph:Graph = new Graph();
content_mc.addChild(graph);

Any help will be appreciated

Thanks in Advance

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 13, 2010

click file/publish settings/flash and tick "permit debugging".  retest.  the line number with the error will be in the error message.  if that's the same line as one you posted, show how you create content_mc.

July 13, 2010

Thanks for your reply

I did what you say , but I still have the same error

and I have create the content_mc

insert-> new symbol -> Enter the name of content_mc -> choose the option export fpr actionscript and then click ok

and I have creating some shapes in it and test it with the scrollpane and it's working

but when i remove the shapes and use the action script to add an inistance from my graph to it i have the previous error

Thanks in Advance

July 13, 2010

I have tried to put the code inside the first frame of content_mc and it's works when i was drawing a shape inside the movie clip but when i removed the shape it doeasn't work