Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ArgumentError: Error #1063

Engaged ,
Oct 28, 2011 Oct 28, 2011

Total time fine, playing fine, scrubber click fine. But

only if i move scrubber message is showing in output

ArgumentError: Error #1063: Argument count mismatch on Player_as3_fla::MainTimeline/videoStatus(). Expected 1, got 0.

          at Function/http://adobe.com/AS3/2006/builtin::apply()

          at SetIntervalTimer/onTimer()

          at flash.utils::Timer/_timerDispatch()

          at flash.utils::Timer/tick()

Now My script is

var newMeta:Object = new Object();

newMeta.onMetaData = onMetaData;

ns.client=this;

var amountLoaded:Number;

var duration = Number;

var vFrame:MovieClip=new MovieClip();

this.addChild(vFrame);

vFrame.addEventListener(Event.ENTER_FRAME, videoStatus);

function onMetaData(newMeta:Object):void

{

    duration = newMeta.duration;

          var durmin = duration/60;

                    var hours = Math.floor(durmin/60);

          if (duration>=3600) {

          var minutes = Math.floor(durmin%60);

          }

          else{

                     minutes = Math.floor(duration/60);

          }

          var seconds = Math.floor(duration%60);

          if (hours2<10) {

                    hours = "0"+hours;

          }

          if (minutes<10) {

                    minutes = "0"+minutes;

          }

          if (seconds<10) {

                    seconds = "0"+seconds;

          }

controls.totalTime.text= hours+":"+minutes+":"+seconds;

}

function videoStatus(event:Event):void

{

          amountLoaded = ns.bytesLoaded/ns.bytesTotal;

          controls.seekbar.loadBar.width = amountLoaded*330;

          controls.seekbar.scrub.x = ns.time/duration*320;

}

TOPICS
ActionScript
8.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Oct 28, 2011 Oct 28, 2011

I see that you are calling this videoStatus function from Event.ENTER_FRAME handler and also with a timer after dragging scrubber. I believe the problem is that while you are dragging scrubber, the enterFrame function is settings position of the scrubber -> the conflict.

I would change this line

vFrame.addEventListener(Event.ENTER_FRAME, videoStatus);

to

videoInterval = setInterval(videoStatus, 100);

Translate
Enthusiast ,
Oct 28, 2011 Oct 28, 2011

change videoStatus function to:

function videoStatus(event:Event = null):void

{

          amountLoaded = ns.bytesLoaded/ns.bytesTotal;

          controls.seekbar.loadBar.width = amountLoaded*330;

          controls.seekbar.scrub.x = ns.time/duration*320;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 28, 2011 Oct 28, 2011

Do you have other code for whatver you are calling the scrubber?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 28, 2011 Oct 28, 2011

i put this

  null):void

now error is gone, but srubber not correctly moving through mouse move.

Other Code is

function videoStatus(event:Event = null):void

{

          amountLoaded = ns.bytesLoaded/ns.bytesTotal;

          controls.seekbar.loadBar.width = amountLoaded*330;

          controls.seekbar.scrub.x = ns.time/duration*320;

}

function videoScrubberDown(event:MouseEvent):void 

    var bounds:Rectangle = new Rectangle(0,0,320,0); 

    clearInterval(videoInterval); 

    scrubInterval = setInterval(scrubTimeline, 10); 

    controls.seekbar.scrub.startDrag(false, bounds); 

    stage.addEventListener(MouseEvent.MOUSE_UP, stopScrubbingVideo); 

function scrubTimeline():void 

          ns.seek(Math.floor((controls.seekbar.scrub.x/320)*duration));

function stopScrubbingVideo(Event:MouseEvent):void 

    stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrubbingVideo); 

    clearInterval(scrubInterval); 

    videoInterval = setInterval(videoStatus, 100); 

    controls.seekbar.scrub.stopDrag(); 

}

function clickableScrubber(Event:MouseEvent):void

{

          controls.seekbar.scrub.x= controls.seekbar.btnProgressBar.mouseX;

          controls.seekbar.scrub.x= controls.seekbar.mouseX;

          ns.seek(Math.floor((controls.seekbar.scrub.x/320)*duration));

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 28, 2011 Oct 28, 2011

I see that you are calling this videoStatus function from Event.ENTER_FRAME handler and also with a timer after dragging scrubber. I believe the problem is that while you are dragging scrubber, the enterFrame function is settings position of the scrubber -> the conflict.

I would change this line

vFrame.addEventListener(Event.ENTER_FRAME, videoStatus);

to

videoInterval = setInterval(videoStatus, 100);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 28, 2011 Oct 28, 2011
LATEST

Yaa it's Working fine.

Thankyou.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines