FLVPlayback Skin Timer
Does anyone know how to add a timer or for that matter any listener script inside an FLVPlayback skin? I have a time placed on top of the skin but when the full screen button is pressed the timer does not scale with the skin and is no longer visible. I am assuming I then need to add it to the customized skin but cannot figure out how to communicate between an FLV skin and the swf that is loading the flv into it. Any help would be useful.
Thanks
Adobe > ActionScript 1 and 2
Posted on: 06/13/2007 11:45:15 AM
View Complete Forum Thread with Replies
Sponsored Links:
Loadig Skin In FLVPlayback
Hi guys just a simple question. Is it possible to load an external skin for the FLVPlayback? I mean from a remote path (http://www....), I've tried but so far I couldn't come up with a solution!
Thanx in advance
Giano
View Replies !
View Related
FLVPlayback Skin Not Showing
Hi,
I am using FLVPlayer 8 with the skin: "ArcticExternalAll.swf" all contained in the same folder. The component properties are setup so that "ArcticExternalAll.swf" is the skin.
The shell.swf (holds the FLVPlayer 8) gets the content path and time through variables sent via php. The movie works fine, but the skin and the player controls aren't visible.
Is there any properties, etc. I can check that may be causing this problem?
Thanks for any help,
~Oni.
-- I posted this in the Actionscript forum, but I think it may be more appropriate here.
View Replies !
View Related
Missing Skin In FLVPlayback
I have a Slide presentation that is controlled with cue points in actionscript 2.0. The presentation advances and resets according to the running time of the streaming FLV.
The problem is that everything tests well but in real life the swf loads without the FLV skin, hence vo controls.
The FLV plays fine and the presentation advances correctly.
View Replies !
View Related
Customize FLVPlayback Skin
I am following the tutorial entitled "Creating a Dynamic Playlist for Streaming Flash Video" and I am unable to set the playback window size. Here is the original code followed by my attempt. I am new to flash, so I am flying blind here. PLEASE HELP. Here is what is happening now: http://71.129.34.15 (dynamic ip so I will have to update)
ORIGINAL
import mx.video.*;
//Set up the list box, call function VideoThumb to create the actual thumbnails
list.rowHeight = 70;
list.cellRenderer = "VideoThumb";
list.selectable = true;
//create new empty listener object
listListener = {};
nc = new NetConnection(); //create a connection
nc.connect( nav.attributes.url ); //connect to FCS
ns = new NetStream(nc); //create a stream
ns.connect(); //connect the stream
nc.connect(null);
var stream_ns:NetStream = new NetStream(nc);
stream_ns.play("video2.flv");
// Create function to trace all the status info.
function traceStatus(info) {
Message.text+="Level: " + info.level + " Code: " + info.code+"
";
}// Assign this function to onStatus handlers when you create objects.
//Function to handle what happens when an item in the list is selected
listListener.change = function( evtobj ) {
var nav = list.dataProvider[list.selectedIndex];
var reset = true;
for ( var i = 0; i < nav.childNodes.length; i++ ) {
var stream = nav.childNodes;
if ( stream.nodeName == "stream" ) {
attachMovie("FLVPlayback", "my_FLVPlybk", 10, {width:320, height:240, x:90, y:100});
//center the FLVPlayback component when FLV is ready to play
var listenerObject:Object = new Object();
listenerObject.resize = function(eventObject:Object):Void {
//center video in playback area
newx = (460 - my_FLVPlybk.preferredWidth)/2;
newy = (470 - my_FLVPlybk.preferredHeight)/2;
my_FLVPlybk._x = newx;
my_FLVPlybk._y = newy;
};
my_FLVPlybk.addEventListener("resize", listenerObject);
listenerObject.ready = function(eventObject:Object):Void {
my_FLVPlybk.setSize(250, 350);
};
my_FLVPlybk.skin = "SteelExternalAll.swf";
my_FLVPlybk.clear();
my_FLVPlybk.contentPath = nav.attributes.url + "/_definst_/" + stream.attributes.name+".flv";
my_FLVPlybk.autoSize = true;
//trace(my_FLVPlybk.contentPath);
reset = false;
}
}
}
//Add an event listener on the list, when it triggers, run the listListener function to repopulate the list
list.addEventListener("change", listListener);
//Function that loads the XML file, parses it, and builds the list of available video clips
var xmllist = new XML(); //setup a variable to hold the XML
xmllist.ignoreWhite = true;
xmllist.load( "playlist-demo-1.xml" ); //load the XML file
//The following gets called when the XML has been loaded
xmllist.onLoad = function( status ) {
if ( !status )
trace( status );
var entries = this.childNodes[0];
var playlists = {};
var nav = [];
for ( var i = 0; i < entries.childNodes.length; i++ ) {
var entry = entries.childNodes;
if ( entry.nodeName == "listitem" )
//builds array of video clip names
playlists[entry.attributes.name] = entry;
else if ( entry.nodeName == "menu" ) {
//builds array of available videos
for ( var j = 0; j < entry.childNodes.length; j++ )
nav[j] = playlists[entry.childNodes[j].attributes.name];
} //end else if
} //end if
//sends the array of videos to the listbox UI
list.dataProvider = nav;
} //end xmllist.onload
MY VERSION
import mx.video.*;
//Set up the list box, call function VideoThumb to create the actual thumbnails
list.rowHeight = 70;
list.cellRenderer = "VideoThumb";
list.selectable = true;
//create new empty listener object
listListener = {};
nc = new NetConnection(); //create a connection
nc.connect( nav.attributes.url ); //connect to FCS
ns = new NetStream(nc); //create a stream
ns.connect(); //connect the stream
nc.connect(null);
var stream_ns:NetStream = new NetStream(nc);
stream_ns.play("video2.flv");
// Create function to trace all the status info.
function traceStatus(info) {
Message.text+="Level: " + info.level + " Code: " + info.code+"
";
}// Assign this function to onStatus handlers when you create objects.
//Function to handle what happens when an item in the list is selected
listListener.change = function( evtobj ) {
var nav = list.dataProvider[list.selectedIndex];
var reset = true;
for ( var i = 0; i < nav.childNodes.length; i++ ) {
var stream = nav.childNodes;
if ( stream.nodeName == "stream" ) {
attachMovie("FLVPlayback", "my_FLVPlybk", 10, {width:470, height:405, x:90, y:100});
//center the FLVPlayback component when FLV is ready to play
var listenerObject:Object = new Object();
listenerObject.resize = function(eventObject:Object):Void {
//center video in playback area
newx = (460 - my_FLVPlybk.preferredWidth)/2;
newy = (470 - my_FLVPlybk.preferredHeight)/2;
my_FLVPlybk._x = newx;
my_FLVPlybk._y = newy;
};
my_FLVPlybk.addEventListener("resize", listenerObject);
listenerObject.ready = function(eventObject:Object):Void {
my_FLVPlybk.setSize(470, 405);
};
my_FLVPlybk.skin = "SteelExternalAll.swf";
my_FLVPlybk.clear();
my_FLVPlybk.contentPath = nav.attributes.url + "/_definst_/" + stream.attributes.name+".flv";
my_FLVPlybk.autoSize = true;
//trace(my_FLVPlybk.contentPath);
reset = false;
}
}
}
//Add an event listener on the list, when it triggers, run the listListener function to repopulate the list
list.addEventListener("change", listListener);
//Function that loads the XML file, parses it, and builds the list of available video clips
var xmllist = new XML(); //setup a variable to hold the XML
xmllist.ignoreWhite = true;
xmllist.load( "playlist-demo-1.xml" ); //load the XML file
//The following gets called when the XML has been loaded
xmllist.onLoad = function( status ) {
if ( !status )
trace( status );
var entries = this.childNodes[0];
var playlists = {};
var nav = [];
for ( var i = 0; i < entries.childNodes.length; i++ ) {
var entry = entries.childNodes;
if ( entry.nodeName == "listitem" )
//builds array of video clip names
playlists[entry.attributes.name] = entry;
else if ( entry.nodeName == "menu" ) {
//builds array of available videos
for ( var j = 0; j < entry.childNodes.length; j++ )
nav[j] = playlists[entry.childNodes[j].attributes.name];
} //end else if
} //end if
//sends the array of videos to the listbox UI
list.dataProvider = nav;
} //end xmllist.onload
View Replies !
View Related
FLVPlayback Skin Not Showing
Hi,
I am using FLVPlayer 8 with the skin: "ArcticExternalAll.swf" all contained in the same folder. The component properties are setup so that "ArcticExternalAll.swf" is the skin.
The shell.swf (holds the FLVPlayer 8) gets the content path and time through variables sent via php. The movie works fine, but the skin and the player controls aren't visible.
Is there any properties, etc. I can check that may be causing this problem?
Thanks for any help,
~Oni.
View Replies !
View Related
FLVplayback UI Skin Breaks
I loading an FLVplayback component dynamically through XML playlist.
I also have the FLVplayback 's autoPlay property set to false.
When the initial FLV is loaded, all is well. However when the FLVplayback gets loaded with a new FLV, the skin breaks. The buffering and seek bar is still visibly loading the new FLV, however, all play/stop UI is greyed out and non-clickable.
The new FLVs load fine when autoPlay =true.
I've even tried to re-define the skin once the new clip loads, but nothing.
View Replies !
View Related
FLVPlayBack Hide Skin
Hi All,
I am working on a flex media center, but I used the Flash FLVPlayBack Component with the Flex Component Kit because the Flex Video Component is very basic. I am adding fullscreen functionality and the original video is pretty small. What I want to do it show the skin of the FLVPlayBack Component only in FullScreen mode. I created a listener, however I cannot find a method or property to hide the skin. Is there such a thing? I noticed "skinAutoHide", but not what I want.. There must be something like 'skin.show/hide"?
Thank-you in advance.
View Replies !
View Related
FLVPlayBack Fullscreen Skin
Hi All,
I am working on a flex media center, but I used the Flash FLVPlayBack Component with the Flex Component Kit because the Flex Video Component is very basic. I am adding fullscreen functionality. I want to show the skin of the FLVPlayBack Component only in FullScreen mode. I created a listener, however I cannot find a method or property to show a skin. Is there such a thing? I noticed "skinAutoHide", but not what I want.. There must be something like 'skin.show/hide"?
I tried: myplayer.skin = ""; and myplayer.skin = "myswf.swf"; But I get errors...
Thank-you in advance.
View Replies !
View Related
[AS2] FLVPlayback Skin Scrubber Issue
Hi,
I have a custom skin for a flvplayback ( which is only a color change from the standard metal gray ). My problem is while a movie is streaming, if i move the scrubber beyond the streamed section the video completely freezes and I can't interact with it. There are two different things I want the scrubber to do in order to solve this:
1.) Prevent the scrubber from moving past the streamed portion
2.) If the scrubber is moved beyond the streamed portion, then start streaming from where the scrubber is moved.
Also, I'm using AS2 and can't switch to AS3 at this moment.
Help would be really appreciated. I did a search on but couldn't find any threads relating to this issue.
Thanks.
View Replies !
View Related
FLVplayback Skin Shows On Web Page
Hi,
I have an FLVPlayback component on the stage. When I press a button it loads an flv movie clip. However if I do not press the burron, the skin of the FLVPlayback component shows on the web page. How do I prevent this from happening ?
Thanks,
Paul
View Replies !
View Related
Non-Standard Buttons In FLVPlayback Skin
I posted this before but I don't think I explained it very well. I'm trying to add a non-standard button to my FLVPlayback skin, but it's not showing up. Can you add new buttons (with new functionality) to FLVPlayback skins or can you only edit the existing ones? This should be similar to adding a logo, does anyone have a tutorial or anything on adding a logo to an FLVPlayback skin?
View Replies !
View Related
FLVPlayback - Customization Problem From A Skin FLA?
I've been reading up on customizing the FLVPlayback component for a Flash 8 video tool I'm building. I'm stumped about starting my customization from a pre-existing skin FLA. Here's why...
I started with the ClearExternalAll.fla file -- the simple clear skin with ALL controls turned on and the chrome background on the bottom of the video window.
I need to remove a few controls and redo the layout in the layout_mc file -- specifically the forward/backward buttons, the forward/backward background, and the volume slider. I'm doing this because there are no preset skins included with Flash 8 that have this configuration.
When I remove these clips (I just turned them into guide layers -- they're not exported) in the layout_mc clip and then use the skin, I see the assets from the right side of the skin FLA in my final FLA using this skin.
What is doing that? What is the proper way to remove controls from the skin FLA before export? I looked in some of the preset skins that have fewer controls, and the layout_mc clip doesn't have the things that are disabled, yet the skin assets are still present in the skin FLA AND the exported FLA using said skin.
Thanks,
IronChefMorimoto
View Replies !
View Related
Accessing FLVPlayback Methods From A Skin
I'm sure there's a way to do this (I think I'm just missing what the proper syntax is):
Is it possible to access methods and properties of an FLVPlayback instance from a custom skin? I have modified one of the prebuilt skin .fla's that come with CS3, but I don't know how to access information from the playback component that calls it.
Example: I have a couple of text boxes in the skin .fla - one shows current playback time and the other shows total playback time. They work great when all of my actionscript is in the main fla (the one that contains the flvplayback component), but can I include code in the skin that does the same? Seems like a better place for it, since I'd be able to then reuse this skin for other projects.
Thx.
View Replies !
View Related
[CS3] Changes To FLVPlayback Skin Not Taking Effect
This is really strange. I have a custom FLVPlayback skin that I modified after loading the fla file. I published the .swf and placed it in the relative directory. I double checked to ensure that the assignment of the customeSkin.swf is the same as the actual customeSkin.swf.
When I load the customeSkin.swf from my directory, is shows the changes. When I test the .fla that is using the customeSkin.swf, I still see the default colors. This leads me to believe that there is something wrong with the code in the .fla that is loading the customeSkin.swf.
Code:
video.skin = "customeSkin.swf"; // assignment of the custom skin
any ideas?
View Replies !
View Related
[CS3][AS2] FLVPlayback Skin Scrubber Issue
Hi,
I have a custom skin for a flvplayback ( which is only a color change from the standard metal gray ). My problem is while a movie is streaming, if i move the scrubber beyond the streamed section the video completely freezes and I can't interact with it. There are two different things I want the scrubber to do in order to solve this:
1.) Prevent the scrubber from moving past the streamed portion
2.) If the scrubber is moved beyond the streamed portion, then start streaming from where the scrubber is moved.
Also, I'm using AS2 and can't switch to AS3 at this moment.
Help would be really appreciated. I did a search on but couldn't find any threads relating to this issue.
Thanks.
View Replies !
View Related
Functions From Skin To Flvplayback File.. Localconnection?
I'm using standard video components in flash 9 using as3 and a basic skin. I have inserted some custom buttons into the skin fla which change the size of the flvplayback area (which is dynamically populated by javascipt - all working without problem).
My problem is I'm unsure how to link these two files so that the function in the skin will recognise the flvplayback area in the main file. All of the standard buttons, playpause etc are working.
This is the function & the mouse event in the skin that I'm using
Code:
function lansize(event:MouseEvent):void
{dis_compound.setSize(600, 480);}
Code:
lanselect.addEventListener(MouseEvent.CLICK, lansize);
At the moment of course I'm just getting a lot of 'undefined' errors because the dis_compound is not in the skin file with the function & button.. I'm new to as3 but familiar with with 2.0
I thought there is probably something really basic to be added to the flvplayback area name that I'm missing - but if a localconnection the best way to go with this can someone help with the correct way to set it up?
Thanks for any help.
View Replies !
View Related
FLVPlayback: Scale Video, Not Skin/Screen
I have managed to dynamically create an FLVPlayback with AS3 that will dynamically load an flv file. However, I now receive the unwanted effect that when the video is loaded in, the skin of hte player scales down to fit the video. What I want it to do is scale the video to fit the skin's screen, BUT to keep the aspect ratio of the flv.
So for instance, if I have a video that is 300x100 and my skin's screen is 600x600, the video should scale up to 600x300 (not 600x600).
At the moment, with the same example, the video would stay at 300x100 and the skin would scale down to 300x100.
Thanks for any help!
View Replies !
View Related
Video Skin Issues With FLVPlayback (Solved)
I have a FLVPlayback in a movie clip called samples movie. Its embedded into another mc. I also have the ClearOverPlayMute.swf in the same folder as the flash movie. When I demo the movie in the flash pro all works but when i publish to the website it doesn't show up when I mouse over are set the skinAutoHide set to true. What did I miss?
Edited: 04/17/2007 at 08:24:59 AM by Soljaboy1906
View Replies !
View Related
FLVPlayback: Scale Video, Not Skin/Screen
I have managed to dynamically create an FLVPlayback with AS3 that will dynamically load an flv file. However, I now receive the unwanted effect that when the video is loaded in, the skin of hte player scales down to fit the video. What I want it to do is scale the video to fit the skin's screen, BUT to keep the aspect ratio of the flv.
So for instance, if I have a video that is 300x100 and my skin's screen is 600x600, the video should scale up to 600x300 (not 600x600).
At the moment, with the same example, the video would stay at 300x100 and the skin would scale down to 300x100.
Thanks for any help!
View Replies !
View Related
FLVPlayback: Scale Video, Not Skin/Screen
I have managed to dynamically create an FLVPlayback with AS3 that will dynamically load an flv file. However, I now receive the unwanted effect that when the video is loaded in, the skin of hte player scales down to fit the video. What I want it to do is scale the video to fit the skin's screen, BUT to keep the aspect ratio of the flv.
So for instance, if I have a video that is 300x100 and my skin's screen is 600x600, the video should scale up to 600x300 (not 600x600).
At the moment, with the same example, the video would stay at 300x100 and the skin would scale down to 300x100.
Thanks for any help!
View Replies !
View Related
How To Disable A Single Button In FLVPlayback Component Skin?
Hi,
I have a few videos that have no audio, so I don't want any volume or mute controls at all. I chose a skin that doesn't have a volume button, but there isn't one that also has no mute button. Basically, I was wondering if there's a simple method for simply turning off the mute button, visually, and functionally? Nothing really any more fancy than that.
I've read this little tutorial on it, but can't figure out how to adapt this to disabling the mute button only:
http://nerdabilly.wordpress.com/2007.../#comment-2119
If anyone can give advice on this I'd be much obliged!
preesh,
blunderbus
View Replies !
View Related
Adding Total And Elapsed Time To A Custom Skin In FLVPlayback
I have this player and I am using the FLVPlayback. I have tried to include this code in the skin to see the time displayed there, but it doesn't work. If i use this code in the player itself, it works fine but if i place the text zones in the skin to display the time it doesn't show anything. I am at my wits end. how can i make a skin show the total time and duration for a FLVPlayback player?
Attach Code
myFLVPlybk.addEventListener(MetadataEvent.METADATA_RECEIVED, timeListener);
function timeListener(eventObject:MetadataEvent):void {
var totalSeconds = String(eventObject.info.duration);
var durationTime:String = (totalSeconds > 3600 ? Math.round(totalSeconds / 3600) + ":" : "") + (totalSeconds % 3600 < 600 ? "0" : "") + Math.round(totalSeconds % 3600/60) + ":" + (totalSeconds % 60 < 10 ? "0":"") + Math.round(totalSeconds % 60);
timer_mc1.TxttotalTime.text = durationTime;
//trace("Total time is: " + eventObject.info.duration);
}
stage.addEventListener(Event.ENTER_FRAME, updateTime);
function updateTime (ev:Event):void {
var elapsedSeconds = String(myFLVPlybk.playheadTime);
var runTime:String = (elapsedSeconds > 3600 ? Math.round(elapsedSeconds / 3600) + ":" : "") + (elapsedSeconds % 3600 < 600 ? "0" : "") + Math.round(elapsedSeconds % 3600/60) + ":" + (elapsedSeconds % 60 < 10 ? "0":"") + Math.round(elapsedSeconds % 60) ;
timer_mc1.elapsedTime.text = runTime;
//trace("Elapsed time in minutes:seconds: " + runTime);
}
View Replies !
View Related
FLVPlayback Changing Another FLVPlayback
Hi,
I have a movieclip with an FLVPlayback component and a second movieclip on it. In that second movie clip, there's another FLVPlayback component. I was wondering if there was any actionscript I could use in the second movieclip to change the contentPath of the first FLVPlayback component upon the completion of the second FLVPlayback component.
This is the code I tried, but didn't work:
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
this._parent.flvp1.contentPath = "vid2.flv";
}
flvp2.addEventListener("complete", listenerObject);
(flvp1 is the first FLVPlayback component, flvp2 is the second, and vid2.flv is the file to be played in flvp1)
Also, I know that the listenerObject function is working because I tested a trace() command earlier, and it worked.
If anyone could point me in the right direction, I would appreciate it.
Thanks,
Brad
View Replies !
View Related
Difference Between Timer.stop() And Timer.reset()?
Hello,
What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption?
Thanks,
Nilang
View Replies !
View Related
Difference Between Timer.stop() And Timer.reset()?
Hello,
What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption? Code is attached below.
Thanks,
Nilang
Attach Code
// Declarations
var url:URLRequest;// Url
var snd:Sound;// Sound Object
var sndChan:SoundChannel;// Sound Channel Object
var sndPosition:Number;// File offset
var tmr:Timer;// Timer object
var isPlaying:Boolean;// Flag to indicate whether file is
// playing or not
var isPlayDelayed:Boolean;// Flag to indicate whether starting
// of file has been delayed or not
var hours:Number = 0;// Hours
var minutes:Number = 0;// Minutes
var seconds:Number = 0;// Seconds
var milli:Number = 0;// Milliseconds
var pauseTime:Number = 0;// Time when paused
var pauseLength:Number = 0;// Length of pause
var buttonPressTime:Number = 0;//
var timing:Boolean = false;// Flag
// Initialize variables.
isPlaying = false;
isPlayDelayed = true;
sndPosition = 0;
// Get url
url = new URLRequest("sound1.mp3");
// Create new Sound object
snd = new Sound();
// Create new SoundChannel Object
sndChan = new SoundChannel();
// Create a new Timer Object with timeout of 5 sec.
// and repeat it only once.
tmr = new Timer(5000, 1);
// Load the audio file
snd.load(url);
// Enable Event Listeners
tmr.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
stop_btn.addEventListener(MouseEvent.CLICK, onStop);
pause_btn.addEventListener(MouseEvent.CLICK, onPause);
play_btn.addEventListener(MouseEvent.CLICK, onPlay);
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
// Start time
pauseElapsedTime(false);
// Start Timer
tmr.start();
// Function that handles timer events
function onTimerComplete(e:TimerEvent):void
{
// Play audio file when timer complete event is received
sndChan = snd.play(sndPosition);
// Set the isPlaying to true to indicate file is playing
isPlaying = true;
// Set the isPlayDelayed to false
isPlayDelayed = false;
trace("onTimerComplete: " + e);
trace("target: " + e.target);
trace("current target: " + e.currentTarget);
}
// Function that captures frame events
function onEnterFrameHandler(e:Event):void
{
// Local variables
var totalTime:Number = (getTimer()/1000)-pauseLength;
var goTime:Number = totalTime-buttonPressTime;
// If flag is true, then calculate the time that has elapsed
if( timing )
{
// Calculate time
hours = Math.floor(goTime/3600);
minutes = Math.floor((goTime/3600-hours)*60);
seconds = Math.floor(((goTime/3600-hours)*60-minutes)*60);
milli = Math.floor((goTime-(seconds+(minutes*60)+(hours*3600)))*100);
// Display elapsed time
timeText.text = format(hours) + ":" + format(minutes) + ":" + format(seconds) + "." + format(milli);
}
}
// Function that captures mouse click events when user clicks stop button
function onStop(me:MouseEvent):void
{
// Reset time
restartElapsedTime();
if (isPlaying)
{
// If audio file is playing then stop the audio file, set file offset to zero,
// and set isPlaying flag to false
sndChan.stop();
sndPosition = 0;
isPlaying = false;
isPlayDelayed = true;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then reset the timer and
// set isPlaying to false
tmr.reset();
isPlaying = false;
}
}
// Function that captures mouse click events when user clicks pause button
function onPause(me:MouseEvent):void
{
// Pause time
pauseElapsedTime(true);
if (isPlaying)
{
// If audio file is playing then stop the audio file,
// set file offset to current offset, and set isPlaying flag to false
sndChan.stop();
sndPosition = sndChan.position;
isPlaying = false;
}
else if (isPlayDelayed)
{
// If audio playback is delayed then stop the timer and
// set isPlaying to false
tmr.stop();
isPlaying = false;
}
}
// Function that captures mouse click events when user clicks play button
function onPlay(me:MouseEvent):void
{
// Start time
pauseElapsedTime(false);
if (!isPlaying)
{
if (!isPlayDelayed)
{
// If the audio file is not playing and playback is not delayed, then
// play the audio file from the last offset and set isPlaying to true
sndChan = snd.play(sndPosition);
isPlaying = true;
}
else
{
// If the audio file is not playing and playback is delayed, then
// start the timer and set isPlaying to false
tmr.start();
isPlaying = false;
}
}
}
// Function that sets the time to 00:00:00.00 (default)
function restartElapsedTime():void
{
timeText.text = "00:00:00.00";
buttonPressTime = (getTimer()/1000)-pauseLength;
pauseElapsedTime(true);
}
// Function that pauses time
function pauseElapsedTime(b:Boolean):void
{
if( b )
{
pauseTime = getTimer()/1000;
}
else
{
pauseLength = ((getTimer()/1000)-pauseTime)+pauseLength;
}
timing = !b;
}
// Function adds 0 to the front of the number when it is < 10 and
// returns a String
function format(n:Number):String
{
if( n < 10 )
{
return ("0"+n);
}
return n.toString();
}
View Replies !
View Related
Timer - Not Timer Class, But Time Taken To Do Certain Events
So i'm making a little game and want to know how to start a timer and display the number of milliseconds between the start and finish of two different events. I do not want to run a function after 5000 milliseconds or whatever, just record the length of time taken to say click two buttons.
Basically a stopwatch.
I saw the getTimer(); function but i'm not sure of how to use it or if that is what i need.
Once again, thanks for your time.
View Replies !
View Related
Running Timer And Timer With Offset
Hello all,
I'm trying to set up two timers in that dare feed the time in minutes and seconds from the server.
Basically, I've got a master running timer in seconds and minutes but also want to have a second cloned timer that is feed some seconds via flashVars to add to the the master time.
Both of these timers once set by the sever time feed in, and with one being offset, are called every second by a setInterval function call so they count up.
Setting up the master running timer isn't a problem but with my coding skills is a little messy..
Code:
_global.masterRunningTimeInMinutes = 59;
_global.masterRunningTimeInSeconds = 55;
if (_global.masterRunningTimeInSeconds>0 && _global.masterRunningTimeInSeconds<59) {
_global.masterRunningTimeInSeconds++;
} else {
_global.masterRunningTimeInSeconds = 0;
_global.masterRunningTimeInSeconds++;
if (_global.masterRunningTimeInMinutes>=0 && _global.masterRunningTimeInMinutes<=58) {
_global.masterRunningTimeInMinutes++;
} else if (_global.masterRunningTimeInMinutes>=59 && _global.masterRunningTimeInSeconds>=0) {
_global.masterRunningTimeInMinutes = 0;
}
}
if (_global.masterRunningTimeInSeconds<10) {
_global.masterRunningTimeInSeconds = "0"+_global.masterRunningTimeInSeconds;
}
_root.runningTime.text = "v"+_global.masterRunningTimeInMinutes+":"+_global.masterRunningTimeInSeconds;
Ideally I wanted to to get the master running time to display MM:SS so if anyone can help with that that would be great!
I suppose the real problem I'm having is is setting up the pattern for determining the cloned time with the offset.
This is becoming a real headache but if anyone can help I would really appreciate it! Basically I just wanted to have the running time with the cloned time always a certain amount of seconds ahead.
Many thanks, amp3
View Replies !
View Related
Help With Skin
Is there any way that the swf file can load variables from the HTML page it is in? I need the flash to retrieve the variables from the page which it is placed in, and I cannot use the param name tags, instead I can only use the &variablename=blahblahblah technique as it is more user-friendly. The filename of the HTML page will also change, anyone knows how to transfer the variables in an easier way without server-side scripting?
View Replies !
View Related
Onion Skin..
If i am motion tweening a line and then use the onion skin option it lets me see all the places the line will go, and i was wondering if you can make it stay like that while the movie is playing? can that be done??
View Replies !
View Related
Mac OS X Component Skin?
Hello Everyone, just a quick one really. I was wondering whether anyone had come across a decent OS X LookyLikey skin for Flash's UI Components. I bit lazy I know but I don't really feel like re-inventing the wheel at the moment! Cheers.
View Replies !
View Related
Componant Skin
Hi.
i have skinned a combobox and a list box, looks great except when it first loads i get an unsightly flash for a second or two,.. any ideas how to fix this?
cheers.
G
View Replies !
View Related
Video Skin
hi,
To play a video in flash using actionscript (which loads at runtime), you drag a new video clip from the library to the stage.
Then you can create buttons to play, stop etc.
The problem is I wan to create professional buttons on the video clip instead of my own sloppy efforts.
Can I use a pre-made skin for the video somehow in actionscript?Like the one you use in FLVPlayback component.
View Replies !
View Related
Skin Question
how do I make 2 TileList skins look different in 2 separate SWF's but they are loaded into the same loader SWF?
right now, they look different when I test them separate, but when they load into the loader, they have THE SAME SKIN! HELP!!!!!
View Replies !
View Related
I Want To Add A Counter To My Skin
I have Flash 8 Pro. I am a newbie learning how to make progressive streaming videos for my web site. I have selected a skin from the provided templates and have successfully created my SWF file. However, I am clueless as to the rest of the functions in Flash 8.
Now I want to add a counter to my skin that shows minutes/ seconds passed and total minutes/seconds of the video. I have seen this on players around the web but I cannot figure out how this is done in Flash 8 Pro.
Any advice would be appreciated!
View Replies !
View Related
Custum Skin
Hey,
I am trying to make a custom skin for a video file, has anyone got any tips, or links on how this is possible?
Any help would be really appreciated!!
Thanks
G27
View Replies !
View Related
Custom Flv Skin
Hi,
I want to add a differnt flv skin, one that does not come with flash CS 3. When I pick the "add custom skin URL" and I pick http://localhost/myskin.swf I get the following error:
Code:
Error #2044: Unhandled skinError:. text=Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie@c55c791 to flash.display.Sprite.
I also tried to put everything in the same folder without the url, but still get this error. Am I doing something really wrong? Does anybody know how this is done? Also, how to I use the debugger in Flash CS 3 to find out what AVM1Movie@c55c791 means?
Thanks so much,
Johnny
View Replies !
View Related
I Want The Button Skin How To Get It Though...?
Hi,
Rather than reskinning a button, I actually want to take the skin from the standard component button for use on my own button. I'm not sure how though...
Why you ask? Because the removeMovieClip action fails when a button component is on stage (http://www.adobe.com/cfusion/knowle...cfm?id=tn_19435).
I would create my own button similar but when I use the curved edge on a rectangle, it pixelates.
So if anyone could please help me get this skin off the button, or perhaps there's a similar button around that would be great!
Thanks,
Rik
View Replies !
View Related
|