Friday, April 6, 2012
Mobile Screens : Prevent Your Page from Zooming Out / Shrinking on initial load
First up, this useful bit will ensure your site and images doesn't zoom-out automatically when it hits the itty-bitty screens of mobile users.
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
The 'initial-scale=1' ensure my buns scales at 100% on initial load.
One must be more careful with the next parameter. Specifying 'maximum-scale=1' will effectively disable pinch-zooming which we Chweebians think will offend the worshipers of the two-fingered deity Caveatus. We recommend'maximum-scale=2'(as in zoomable to 200%) to keep your buns universally nyum-nyum!
Thanks to David Walsh from whom we gathered these tasty tid-bits!
Friday, July 22, 2011
Child Target Parent Path
That's how the Nimble Nwee felt when it discovered Actionscript 3.0's convoluted (and poorly documented) method of targeting a parent clip, function or another object on the main timeline from a child timeline. Gone are AS 2.0's simpler and zestier 'root','parent','stage'
1. The following examples have won't target or scope from the parent or main level.
//property
trace(parent.nameOfClipTargeted.x)
trace(root.nameOfClipTargeted.x)
//eventhandler
parent.nameOfClipTargeted.addEventListner(MouseEvent.CLICK, myFunction)
//functions
MyCustomFunction(doSomething);
2. You must suffixed the following...
MovieClip(this.parent)
to your objects like so...
//
MovieClip(this.parent).nameOfClipTargeted.x
//
MovieClip(this.parent).nameOfClipTargeted.addEventListner(MouseEvent.CLICK, myFunction)
Not so Nyum-nyum!
Tuesday, July 19, 2011
AS 3 : Elastic Tween Class
a quick and easy, copy-and-paste ready tutorial on making things bounce, move and stretch in elastic fashion.
Grab your Nyum-nyum codes from here...
Monday, June 20, 2011
AS 3.0 : Email Validation Script
Tuesday, April 19, 2011
AS 3.0 : Setting Masks
NameofClip_You_Want_to_Mask.mask=InstanceNameofMaskingShape
Thursday, March 17, 2011
CSS : Fixed Unscrollable Background Image
Monday, January 31, 2011
AS 2.0 : Streaming Videos
I'm freeze-drying the following after an arduous search. Documentation for this Actionscript 2.0 Streaming Video recipe is becoming as scarce as unicorns. Note, this chunk of Nyum-nyum code is timeline based and does not include action-scripted player controllers like pause or volume (sorry!).
1. But First-Things first: Create a video object on the stage :
File>Import>Import Video
2. A dialog box will prompt for the remote location of the video. The video object will be created on the stage as a rectangular outline.
3. Place the the following in the very first frame.
//......................Cross Domain
Security.allowDomain('*');
//.........................Define Establish A STREAM
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
//.........................SHOW VIDEO
myVideo.attachVideo(ns);
myVideo.smoothing = true;
//
ns.setBufferTime(1);
//........................................
ns.onMetaData = function(item:Object):Void {
trace("metaData");
};
ns.onCuePoint = function(item:Object):Void {
trace("cuePoint");
trace(item.name+"\t"+item.time);
};
//.......................STATUS of STREAM
ns.onStatus = function(info) {
//
if (info.code == "NetStream.Buffer.Full") {
trace("I'm Ready To Stream");
}
//
if (info.code == "NetStream.Play.Start") {
trace("start Streaming");
}
// ....... IF FINISH do this
if (info.code == "NetStream.Play.Stop") {
ns.close();
//you can specify some action here
trace("end Streaming");
}
};
//............... Play This VIDEO FROM This Server Location
//...............You can assign this to a Button Action
ns.play("http://myvideolocation.com/myvideo.swf");