In flash with as3.0, I have to call a function on the main stage from a movieClip

前端 未结 4 1755
盖世英雄少女心
盖世英雄少女心 2020-12-22 04:07

I have to call a function that is defined on the main stage of my project, and I have to call it from a MovieClip, what can I do? I\'m using flash cs5.5 and AS3.0

4条回答
  •  粉色の甜心
    2020-12-22 04:35

    When I read your question it sounds as though you have a function defined in an action frame of your main timeline.

    My answer may be out of reach for your current project, and ToddBFisher's answer is perfectly right. That said - I'm going to answer the question differently.

    Instead of defining a function on the main timeline, set up a document class, define your functions there, and access the class's functions in your code. Keep as much code off your timelines as possible.

    Downloadable files for Document Class example: http://www.isgoodstuff.com/2008/06/06/actionscript-30-documentclass-in-plain-english/

    Setting up an AS3 class: http://www.adobe.com/devnet/flash/quickstart/creating_class_as3.html

提交回复
热议问题