17 August, 2009

Goals of Asp.Net 2.0

The Goals of ASP.NET 2.0---------------------------They are1. Developer productivity2. Administration and management3. Performance and scalabilityDeveloper productivity: Much of the focus of the asp.net 2.0 is on productivity. It achieved it by introducing new controls like Gridview, detailsview, masterpages, sitenavigation and etc.Administration and management: Asp.net 2.0 now includes a Microsoft Management Console(MMC) snap-in that enables web application administrators to edit configuration settings easily.This allows system administrators to edit the contents of the machine.config and web.config files directly from the dialog instead of having them examine the contents of an xml file.In addition to this dialog, web or system administrators have a web based way called web administration tool to administer their asp.net 2.0 applications.Performance and scalability: One of the most exciting performance enhancements of asp.net 2.0 is its Caching capability. It includes a feature called SQL Cache invalidation.Before asp.net 2.0 it was possible to cache the results from sql server and to update the cache based on a time interval- for ex. every 10 sec so on. This means that the end user might see stale data if the result set changed sometime during 10 sec period. but by using asp.net2.0 new feature sql cahe invalidation the output cache is triggred to change when the result set from sql server changes.In addition to this asp.net 2.0 now provides 64 bit support.This means that now you can run your asp.net applications on a 64 bit Intel or AMD processors.

05 August, 2009

Flash Player Source Code

/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
// GENERAL VIDEO PLAYER
/////////////////////////////////////////////////////
// Version 2.0
// Stephen Weber
///////////////////////////////////////////////////////
//
//TO RUN THIS WITH THE INCLUDED EXTRA EFFECTS YOU NEED TO HAVE MC_TWEEN2 LIBRARY
//GET THIS LIBRARY AT: http://hosted.zeh.com.br/mctween/
//INSTALL THE EXTENSION AND WHEN YOU PUBLISH IT WILL BE AUTOMATICALLY INCLUDED
#include "mc_tween2.as"
/////////////////////////////////////////////////////
// USER CONFIGURABLE VARIABLES
/////////////////////////////////////////////////////
//VIDEO TO BE PLAYED PATH
//Type the directory of the video to be played
var videoDirectory:String = "";
//Type the filename of the video file that you want to be played
var videoFileName:String = "video01.flv";
//
//Width of the Progress Bar
var barWidth:Number = new Number(progressBar._width);
//Set This Variable To True If You Want The Video To Trace
//Its Current Time and Total Time Consistently
var traceTime:Boolean = false;
//
//Set This Variable To However Many Miliseconds You Want The Video Controls
//FastForward and Rewind To Skip By
var skipTime:Number = 4;
//
//Set The Initial Volume of Video
//Note: Set this volume as a percentage
var initialVolumeLevel:Number = 50;
////////////////////////////////////////
// CUSTOMIZATION
////////////////////////////////////////
//SET THESE VARIABLES TO TURN ON AND OFF CERTAIN FUNCTIONALITY
//SET THESE TO TRUE TO TURN ON FUNCTIONALITY
//SET THESE TO FALSE TO TURN OFF FUNCTIONALITY
//
//VIDEO SCRUBER TO FASTFORWARD AND REWIND
var gotScrubber:Boolean = true;
//
//TO BE ABLE TO SEEK BY CLICK ON THE BAR TO SEEK TO THAT AREA
var barSeek:Boolean = true;
//
//SHOW MUTE BUTTON
var gotMuteButton:Boolean = true;
//
//SHOW VOLUME SLIDER BAR AND SCRUBBER
var gotVolumeSliderBar:Boolean = true;
//
//SHOW FASTFORWARD BUTTON
var gotFastForwardButton:Boolean = true;
//
//SHOW REWIND BUTTON
var gotRewindButton:Boolean = true;
//
////////////////////////////////////////
// FUNCTIONS
////////////////////////////////////////
//Loads Whatever FLV Video File You Send It
function playVideo(videoFile) {
stream_ns.play(videoDirectory + videoFile);
playMC._visible = false;
pauseMC._visible = true;
}
////////////////////////////////////////
// VIDEO ACTIONS
////////////////////////////////////////
//
////////////////////////////////////////
// VARIABLES
////////////////////////////////////////
progressBar._xscale = 0;
bufferBar._xscale = 0;
//Define Connection
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
//Progressive download.
var stream_ns:NetStream = new NetStream(connection_nc);
//Preloader
preloaderBar();
//Attach NetStream To Video Holder
my_video.attachVideo(stream_ns);
//This prevents the movie from playing right away, while it still preloads
stream_ns.seek(2);
stream_ns.pause();
////////////////////////////////////////
// Seek Functionality
////////////////////////////////////////
if (barSeek) {
bufferBar.onPress = function() {
//trace(bufferBar._xmouse);
var ratio = total_time / barWidth;
seekTime = ratio * bufferBar._xmouse;
stream_ns.seek(seekTime);
};
}
////////////////////////////////////////
// Audio Controller
////////////////////////////////////////
this.createEmptyMovieClip("flv_mc",this.getNextHighestDepth());
flv_mc.attachAudio(stream_ns);
var audio_sound:Sound = new Sound(flv_mc);
function progBar() {
progressBar._xscale = (stream_ns.time / total_time) * 100;
//If Movie reaches 98%, stop Fast Forwarding.
if (progressBar._xscale > 98) {
clearInterval(timer);
stream_ns.time = total_time;
}
if (traceTime) {
trace("Current time = " + stream_ns.time + " Total time = " + total_time);
} else {
}
}
stream_ns.onStatus = function(infoObject:Object) {
if (infoObject.code == "NetStream.Play.Stop") {
clearInterval(prog);
clearInterval(timer);
progressBar._xscale = 100;
rewindMC.enabled = false;
forwardMC.enabled = false;
videoBumper_mc.gotoAndPlay(2);
stream_ns.seek(0);
stream_ns.pause();
playMC._visible = true;
pauseMC._visible = false;
playMC.alphaTo(100,1);
}
};
startVideo2();
stream_ns.onMetaData = function(obj) {
total_time = obj.duration;
timer = setInterval(progBar, 20);
};
////////////////////////////////////////
// Preloader
////////////////////////////////////////
function preloaderBar() {
loaded_interval = setInterval(checkBytesLoaded, 10, stream_ns);
function checkBytesLoaded(stream_ns:NetStream) {
pctLoaded = stream_ns.bytesLoaded / stream_ns.bytesTotal * 100;
//trace(pctLoaded);
if (pctLoaded <= 100) { bufferBar._xscale = pctLoaded; trace(pctLoaded); } if (pctLoaded >= 100) {
clearInterval(loaded_interval);
progressBar_mc._visible = false;
}
}
}
////////////////////////////////////////
// Video Controls
////////////////////////////////////////
playMC._visible = true;
pauseMC._visible = false;
initial = 1;
playMC.onRelease = function() {
rewindMC.enabled = true;
forwardMC.enabled = true;
videoBumper_mc.gotoAndStop(1);
stream_ns.pause();
playMC._visible = false;
pauseMC._visible = true;
pauseMC.alphaTo(100,1);
playMC.alphaTo(0,1);
};
pauseMC.onRelease = function() {
playMC._visible = true;
stream_ns.pause();
pauseMC._visible = false;
playMC.alphaTo(100,1);
};

////////////////////////////////////////
// Rewind Controls
////////////////////////////////////////
if (gotRewindButton) {
var startingTime = stream_ns.time;
rewindMC.onPress = function() {
vidControl = function () {
stream_ns.seek(startingTime - skipTime);
startingTime = startingTime - skipTime;
};
timer = setInterval(vidControl, 200);
};
rewindMC.onRelease = rewindMC.onDragOut = function () {
clearInterval(timer);
};
} else {
rewindMC._visible = false;
}
////////////////////////////////////////
// Fastforward Controls
////////////////////////////////////////
if (gotFastForwardButton) {
forwardMC.onPress = function() {
vidControl = function () {
stream_ns.seek(stream_ns.time + skipTime);
};
timer = setInterval(vidControl, 200);
};
forwardMC.onRelease = forwardMC.onDragOut = forwardMC.onReleaseOutside = function () {
clearInterval(timer);
};
} else {
forwardMC._visible = false;
}
////////////////////////////////////////
// Volume Scrubber
////////////////////////////////////////
//CHECKS TO SEE IF VOLUME SLIDE BAR SHOULD BE ON
if (gotVolumeSliderBar) {

var volumeSlideBarWidth:Number = volumeSliderBar._width;
var volumeSliderStart:Number = volumeSliderBar._x;
var volumeSliderStop:Number = volumeSliderStart + volumeSlideBarWidth;

//Sets the initial volume
audio_sound.setVolume(initialVolumeLevel);
//Sets the initial volume scrubber position
volumeSlider._x = ((initialVolumeLevel/100)*volumeSliderBar._width)+volumeSliderStart;

volumeSlider.onPress = function() {
//Dragging Functionality
volumeSlider.startDrag(false,volumeSliderStart,this._y,volumeSliderStop,this._y);

//Setting Volume Based On X Position Relative To Volume Slider Bar
volumeSlider.onEnterFrame = function() {
ratio = 0;
ratio = Math.round(((volumeSlider._x / volumeSliderBar._width) * 100));
audio_sound.setVolume((ratio - 239)-initialVolumeLevel);
trace("VOLUME SET TO: " + ((ratio - 239)-initialVolumeLevel));
};
};
volumeSlider.onRelease = function() {
stopDrag();
};
volumeSlider.onReleaseOutside = function() {
stopDrag();
};
} else {
//TURN OFF VOLUME SLIDER BAR
volumeSliderBar._visible = false;
volumeSlider._visible = false;
}
////////////////////////////////////////
// Mute Controls
////////////////////////////////////////
if (gotMuteButton) {
muteMC.onRelease = function() {
//If Muted Or Not
if (muteMC._currentFrame == 1) {
//MUTE SOUND
muteMC.gotoAndStop(2);
audio_sound.setVolume(0);
} else {
//UNMUTE SOUND
muteMC.gotoAndStop(1);
audio_sound.setVolume(100);
}
};
} else {
muteMC._visible = false;
}
/////////////////////////////////////////////////////
// INITIAL RUN
/////////////////////////////////////////////////////
stop();
playVideo(videoFileName);