Skip to main content
Known Participant
August 14, 2013
Question

Seekbar Actionscript 3

  • August 14, 2013
  • 1 reply
  • 6358 views

H everyone, trying to get a seekbar to work in my youtube chromeless player in actionscript 3, I've tried to add it with this code but I'm getting a syntax error here: function player.seekTo(seconds:Number, allowSeekAhead:False):Void. The error is 1084: Syntax error: expecting leftparen before dot.
I've tried to work with the Youtube API on this but struggling to use their documentation to get it to work.
The only bit they have about a seek bar is this:


player.getClickToPlayButton(videoId:string, startSeconds:Number, suggestedQuality:String):DisplayObject
Creates and returns a thumbnail that functions as a click-to-play button for a video. The button is an extension of the player that issued it, and when the button is clicked, the player will play the associated video. This function, which is only supported in the Flash (AS3) Player API, provides the best way to trigger a video playback when a user clicks on a video thumbnail.

  • The required videoId parameter identifies the video associated with the new button. The button is skinned with the video's hqdefaultthumbnail image. Since the button displays the video's thumbnail image, the application does not need to retrieve the video thumbnail image URLs using the YouTube Data API.
  • The optional startSeconds parameter accepts a float/integer and specifies the time from which the video should start playing when the button is clicked. If specified, the video will start from the closest keyframe to the specified time.
  • The optional suggestedQuality parameter specifies the suggested playback quality for the video. Please see the definition of thesetPlaybackQuality function for more information about playback quality.


I'm not even sure if I've added it correctly, can someone help me out? Thanks

Below is the code I've tried out:

player.seekBar = seekTo;

function player.seekTo(seconds:Number, allowSeekAhead:False):Void

{

          if (player)

          {

                    player.seekTo();

          }

}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 14, 2013

are you publishing for as3 or as2?

jez212Author
Known Participant
August 14, 2013

actionscript 3

kglad
Community Expert
Community Expert
August 14, 2013

then Void needs to be void.

and

function player.seekTo

makes no sense.  remove that code and retest.