Showing posts with label Thomas Nguy. Show all posts
Showing posts with label Thomas Nguy. Show all posts

Friday, April 6, 2012

Mobile Screens : Prevent Your Page from Zooming Out / Shrinking on initial load

Mobile-enabled sites are becoming as popular as our Lychee stalls in Langston Market. So it behooves us good Chweebians to expand our emporium of Nyum-nyum codes by featuring a section of tasty CSS Mobile tips and treats.

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

How would you like to bite into a Nyum-nyum bun... only to discover a strand of someone's hair mixed up in the wet filling?

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!

Monday, June 20, 2011

AS 3.0 : Email Validation Script

There's nothing more delectable and satisfying than a concisely written code that performs a complex task such as... validating user input boos-boos.

This is by far the EASIEST and most plug-in-ready Flash Email Validation script I've come across. Copy and paste from this link. Just rename your buttons and input field names accordingly.

http://tinyurl.com/EmailValidChwee

This Nyum-nyum code taste like a pillowy chinese Bun with sweet fillings!