Skip navigation
Currently Being Moderated

ArgumentError: Error #1063

Oct 28, 2011 11:04 AM

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;

}

 
Replies
  • Peter Celuch
    505 posts
    Nov 17, 2005
    Currently Being Moderated
    Oct 28, 2011 11:29 AM   in reply to Venkom

    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;
    }
    
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 28, 2011 11:29 AM   in reply to Venkom

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

     
    |
    Mark as:
  • Peter Celuch
    505 posts
    Nov 17, 2005
    Currently Being Moderated
    Oct 28, 2011 12:07 PM   in reply to Venkom

    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); 
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points