A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: 1180 Call to a possibly undefined method addFrameScript. package {

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    2

    1180 Call to a possibly undefined method addFrameScript. package {

    Hi,

    I am new to Flash and going through the examples in the flash_as3_programming.pdf (updated Feb 11, 2009)

    (Flash CS3, actionscript 3.0, XP).

    1. What code needs to be set up in the Actions Panel and what can be in seperate files as packages?

    I am unclear about this and can not seem to find doc that addresses what and why between the Action Panel and the Packages.

    Do I have to have code in the Action Panel to call a package? The Help *seems* to say I don't have to.

    2. I am trying to call a package without entering code in the Action Panel. There are no widgets and the response uses the trace function. I set the Document class with the name of the {file}.as. It's in the same name and directory as the FLA.

    I keep getting the error 1180 Call to a possibly undefined method addFrameScript. package {


    TIA

    Stella
    ------------
    I am including the code below - it is from flash_as3_programming.pdf (updated Feb 11, 2009)

    package
    {
    import flash.display.Sprite;
    import flash.events.TimerEvent;
    import flash.utils.Timer;

    public class ShortTimer extends Sprite
    {
    public function ShortTimer()
    {
    // creates a new five-second Timer
    var minuteTimer:Timer = new Timer(1000, 5);

    // designates listeners for the interval and completion events
    minuteTimer.addEventListener(TimerEvent.TIMER, onTick);
    minuteTimer.addEventListener(TimerEvent.TIMER_COMP LETE, onTimerComplete);

    // starts the timer ticking
    minuteTimer.start();
    }

    public function onTick(event:TimerEvent):void
    {
    // displays the tick count so far
    // The target of this event is the Timer instance itself.
    trace("tick " + event.target.currentCount);
    }

    public function onTimerComplete(event:TimerEvent):void
    {
    trace("Time's Up!");
    }
    }
    }

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    2
    I found it... Return type :void was not on the constructor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center