Skip to main content
Participating Frequently
April 5, 2010
Answered

confused about source path and external code

  • April 5, 2010
  • 1 reply
  • 482 views

Hi,

I created a Jing video to describe my problem (I'm hoping this is helpful and not annoying, let me know). In short, I'm not sure how external AS3 scripts are supposed to referenced, though I did get it to work in AS2 years ago.

This topic has been closed for replies.
Correct answer kglad

create a movieclip button in the flash authoring environment and have your current sprite entending class extend the movieclip class.

1 reply

kglad
Community Expert
Community Expert
April 5, 2010

in as3, you can:

1.  assign a document class (in the properties panel for the stage)

2.  use an import statement and "new" constructor

3.  assign a class to a library asset (by clicking linkage, ticking export for actionscript and assigning the class) and add that asset to a timeline/frame that plays.

genotypeAuthor
Participating Frequently
April 5, 2010

Ok, that begs another question.The object in question is already a simple button. The script I'm trying to bring in extends sprite. The object is called blue_button and is already linked to a class called BlueRolloverButton (currently extending SimpleButton), and the external script is called AnimatedClip and extends Sprite. How do I combine the two? Or don't I? I just want to inlclude some of the methods in AnimatedClip, not really instantiate anything in it.

EDIT: Thanks, BTW 

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 5, 2010

create a movieclip button in the flash authoring environment and have your current sprite entending class extend the movieclip class.