Error 1180: calling undefined addFrameScript method in as3

package {
import flash.display.Sprite;
import flash.utils.*;

public class SetTimeoutExample extends Sprite {
    private var delay:Number = 1000; // delay before calling myDelayedFunction

    public function SetTimeoutExample() {
        var intervalId:uint = setTimeout(myDelayedFunction, delay,stopTime);
    }

    public function myDelayedFunction():void {
        if(arguments[0] ==fk.playheadTime)
        {fk.pause();}
    }
}
}//this is my document class named SetTimeoutExample.as

import flash.net.URLLoader;
import fl.video.*;
import flash.utils.getTimer;
import flash.events.Event;


fk.autoPlay = false;


var myLoaderInfo=new Object();


myLoaderInfo.myParamsLoaded = false;


myLoaderInfo.loaderComplete = loaderComplete;



this.loaderInfo.addEventListener(Event.COMPLETE, myLoaderInfo.loaderComplete);



myLoaderInfo.useParams = useParams;

var myParams:Object = new Object();
var myParamsLoaded:Object = new Object();

function loaderComplete(myEvent:Event)
{
this.myParams = this.loaderInfo.parameters;
this.myParamsLoaded = true;//Parametrelerin yuklendigine emin olduk.

this.useParams();

    fk.play(src);
}

var src:String;
var startTime:Number;
var stopTime:Number;

function useParams()
{
    var obj:Object = new Object();

var j;
for (j in this.myParams)
{
    if (j == "url")
    {
        src = this.myParams[j];
    }
    else if (j=="bas")
    {
        startTime = int(this.myParams[j]);
    }
    else
    {
        stopTime = int(this.myParams[j]);
    }
}
}

fk.addEventListener(VideoEvent.READY, bitti);
function bitti(eventObject:VideoEvent):void
{
    fk.seekSeconds(startTime);


}  //this is my player.fla 

hi, I get this error 1180 in as3.how can I solve this problem? I am google, but I can not apply the solutions for my code. I am really new to as3.thanks for any help.

+3
source share
6 answers

Let me tell you bluntly: you set Document Classfla in the properties and write code directly in fla?

, : .as, fla Document Class, Timeline. , , , Timeline, MovieClip, Document Class extends Sprite , , addFrameScript ( , Timeline SWF ).

,

public class SetTimeoutExample extends Sprite {

public class SetTimeoutExample extends MovieClip {

fla Document Class.

+6

? AddFrameScript() - , . .

, , .

+2

, AS- - TimeLine:

"":

  • CLASS, "" .fla .as( " " ):

    addFrameScript

  • - , - , TimeLine:

    var myClassObject:myClass = new myClass();
    this.addChild(myClassObject);
    
+2

. , Sprite , flash ... , Flash . 30 ....

+1

TypeError: Error # 1034: Coercion failed: the_game @2a9c50b1 flash.display.MovieClip.    :: Player/update()   at the_game_itself/update()

...

0

() ( ), :

Perhaps the library element (movieclip) has actioncript properties set to inherit from Sprite (the base class) ... Some coding error ... Check that the movcriptlips actionscript properties (in the rightclick library (on movie clip) / properties).

0
source

Source: https://habr.com/ru/post/1751721/


All Articles