By Brendon Smith on December 19, 2009
What is mono? Mono is the OpenSouce version of C# and the project by Novell / M$ is growing rapidly. It is amazing to me to see the growth and speed of the Mono Project! It is rapidly catching up to the current Silverlight version. Check out Moonlight 2.0 if you haven’t yet and install [...]
Posted in .net, C#, Microsoft, Mono, Open Source, Silverlight | Tagged C#, Mono, RIA, Silverlight
By Brendon Smith on June 6, 2009
Technologically agnostic and liking it. When it comes to new technologies many come and go so it can be a challenge to see which ones really take root. People love to talk about open source technology and I myself love open technology because it encourages developers like myself to play with whatever I [...]
Posted in .net, ActionScript, Adobe, C#, i-create, Silverlight | Tagged ActionScript, art, C#, Flash Develop, Open Source, Silverlight
By Brendon Smith on May 25, 2009
What are yahoo pipes and why should I care? Yahoo! Pipes is a web application from Yahoo! that provides a graphical user interface for building data mashups that aggregate web feeds, web pages, and other services, creating Web-based apps from various sources, and publishing those apps. The site works by letting users “pipe” information [...]
Posted in .net, ActionScript, i-create, Silverlight | Tagged ActionScript, C#, JSON, Yahoo Pipes
By Brendon Smith on October 26, 2008
Well here it is I have been playing around with Silverlight2 and it is astronomically better than Silverlight1! This is an extermly simple feed reader with no design add more or less a proof of concept. I have been trying to do things in ActionScript and the do them in C#/SilverLight. I have leaned a [...]
Posted in i-create, Silverlight | Tagged ASP.NET, C#, Silverlight
By Brendon Smith on March 14, 2008
Custom C# Control:
Note this is only part of the control. With a little more work you can easily make is so you can drop it on a page and simply name the FlashAudioVariable to point to the name of the flv.
Panel pnlAudioContainer = new Panel();
pnlAudioContainer.ID = string.Concat(this.ID, "_pnlAudioContainer");
pnlAudioContainer.Style.Add("float", "left");
pnlAudioContainer.Style.Add(HtmlTextWriterStyle.Width, "100%");
pnlAudioContainer.Style.Add(HtmlTextWriterStyle.Height, "2px");
Panel pnlAudio = new Panel();
pnlAudio.ID = string.Concat(this.ID, "_pnlAudio");
pnlAudio.Style.Add("display", "inline");
pnlAudio.Style.Add("float", "right");
pnlAudio.Style.Add("_margin-top", "-23px");
pnlAudio.Style.Add(HtmlTextWriterStyle.Width, "90px");
pnlAudio.Style.Add(HtmlTextWriterStyle.Height, "30px");
string Flashobjectstart = "<noscript><object classid=’clsid:d27cdb6e-ae6d-11cf-96b8-444553540000′ codebase=’http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′width=’90′ height=’30′ align=’middle’><param name=’movie’ value=’yourlocatointo.swf’ /><param name=’quality’ value=’high’ /><param name=’bgcolor’ value=’#FFFFFF’ /><param name=’FlashVars’ value=’myVid=rtmp://video/audio/location/";
string Flashobjectmid = "’ /><embed src=’yourlocatointo.swf’ flashvars=’myVid=rtmp://video/audio/location/";
string Flashobjectend = "’ quality=’high’ bgcolor=’#FFFFFF’ width=’90′ height=’30′ align=’middle’ type=’application/x-shockwave-flash’pluginspage=’http://www.macromedia.com/go/getflashplayer’ /></object></noscript>";
string FlashJS1 = "<script language=’javascript’ type=’text/javascript’>FlashAudio(‘";
string FlashJS2 = "’);</script>";
string FlashAudio = string.Concat(Flashobjectstart, audioFileName, Flashobjectmid, audioFileName, Flashobjectend);
string FlashAudio2 = string.Concat(FlashJS1, audioFileName, FlashJS2);
pnlAudio.Controls.Add(new LiteralControl(FlashAudio));
pnlAudio.Controls.Add(new LiteralControl(FlashAudio2));
pnlCaptionMain.Controls.Add(pnlAudioContainer);
pnlCaptionMain.Controls.Add(pnlAudio);
Shared Object in ActionScript3 w/ FlashVars:
There are slight differences in the way the flash player 9 handles flashvars. This is a working example of how a custom flv player would use flash vars to call a video or audio file and play it! It also uses a shared object the benefit of this is its persistence (like a cookie on stereiods) if you had say several videos that you wanted to play on several different pages but you wanted the player to stop / rewind and if your user tells it to stop to remember the user told the flash player to stop here is how you would do that:
ActionScript3 SharedObject External Video / Audio in Flashvars:
import fl.video.*;
var flvControl = display;
var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
var flvSource = flashvars['myVid'];
flvControl.autoRewind = true;
var my_so:SharedObject = SharedObject.getLocal("userPref");
if (my_so.data.stopped == undefined) {
flvControl.play();
flvControl.autoPlay = true;
toggle_btn.gotoAndPlay(1);
} else {
flvControl.stop();
flvControl.autoPlay = false;
toggle_btn.gotoAndPlay(2);
}
function completeHandler(event:VideoEvent):void
{
flvControl.seek(0);
flvControl.play()
}
flvControl.addEventListener(VideoEvent.COMPLETE, completeHandler);
flvControl.source = flvSource;
function toggleHandler(event:MouseEvent):void
{
if( flvControl.playing ){
my_so.data.stopped = 1;
my_so.flush();
flvControl.stop();
toggle_btn.gotoAndPlay(1);
}else{
if(my_so.data.stopped == !undefined)
{
my_so.clear();
}
flvControl.play();
toggle_btn.gotoAndPlay(2)
}
}
toggle_btn.addEventListener(MouseEvent.CLICK, toggleHandler);
Posted in ActionScript, C# | Tagged ActionScript, C#, Flash
Recent Comments