cosmodesktop

Happy Flash/Flex Coder

Ten Principles for Good Design

I’m really like this presentation and the ideas of the “Good Design”, thinks that can apply to any kind of work even the web site. 1. Good design is innovative. 2. Good design makes a product useful. 3. Good design is aesthetic. 4. Good design makes a product understandable. 5. Good design is unobtrusive. 6. [...]

Scale 9 Grid with Gradient work around!!

Today I’ve try to create a scale 9 shape with gradient fill in its shape and found that when create the scale 9 from IDE the gradient will not slice into scale 9 properly. So the result look like it is stretch. The work around that I found after googling for a while is use [...]

การอ่านค่า flashvars จาก swf ที่ถูกโหลดเข้ามา

ปัญหาในการพยายามโหลดค่า flashvars จาก swf ที่ถูกโหลดเข้ามาภายใน swf อีกตัว เป็นปัญหาที่เรียกได้ว่าน่าปวดหัวไม่น้อยทีเดียว แต่จริงๆ แล้ววิธีแก้ปัญหานั้นไม่ยากครับ หลังจากที่ผมพยายามแก้ปัญหาและหาข้อมูลอยู่พักใหญ่ ในที่สุดก็ได้ข้อสรุป คือ ที่ตัว Main นะครับ เวลาอ่านค่า flashvars จะใช้คำสั่ง var myVar:String = this.root.loaderInfo.parameters.whatever; ในขณะที่ถ้าต้องการอ่านค่า flashvars จาก swf ที่ถูกโหลดเข้ามาจะต้องเปลี่ยนคำสั่งเป็น var myVar:String = stage.loaderInfo.parameters.whatever; การเรียกผ่านตัวแปร stage จะเป็นการเรียกไปยัง display container ของ swf ที่ถูกโหลดเข้ามานั่นเอง และหากยังไม่ได้ ก็ยังมีอีกวิธี โดยการส่งค่าตัวแปรต่างๆ เข้าไปตอนโหลด swf อีกตัวนั่นเอง //:: Store loader info var lInfo:Object = this.root.loaderInfo.parameters; //:: [...]

Today I want to add Hibernate feature to Vista?

And I can’t find it in the control panel / power management section. After google around then I found the solution. To disable hibernation: Click Start. Type “powercfg /hibernate off” and then Press Ctrl+Shift+Enter. To enable hibernation: Click Start. Type “powercfg /hibernate on” and then Press Ctrl+Shift+Enter. A command prompt will appear and disappear. The [...]

Sparker

This is another fun animation from simple math. Mainly function that I use are: linear equation : y = ax + b Brownian Circle : radius to point For tweening between each mode was done by TweenLite and the sparking techniq is base on flash drawing api and linear equation with some tune on the [...]

ฟันธงโหลดภาษาไทยใน XML ด้วย AS3 จาก ServerSide

หัวข้อนี้ไม่เขียนภาษาไทยคงจะแปลก เพราะเกี่ยวกับการดึงข้อมูลภาษาไทย จากไฟล์ XML หรือจากการส่งข้อมูลจาก Server แบบ XML Format เรื่องของเรื่องคือ พอดีได้มีโอกาสต้องทำงานดึงข้อมูลภาษาไทยมาแสดงบนหน้าเว็บ ซึ่งเนื้องานที่ทำอยู่ทุกที ไม่ค่อยได้ใช้ภาษาไทยเท่าไหร่ สรุปคือ เกิดปัญหาขึ้น แสดงได้บ้าง ไม่ได้บ้าง มี random character แปลกๆ ต่อท้ายข้อมูลที่โหลดมาบ้้าง ทำให้เกิด XML not well-formed ฟ้องขึ้นมา (ตัวอย่าง well formed xml) สุดท้ายไ้ด้ความช่วยเหลือจาก katopz และ joke และทำให้แก้ปัญหาไปได้ จึงอยากเอามาแบ่งปัน เผื่อว่าจะช่วยลดเวลาในการแก้ปัญหาของท่านอื่นๆ ได้ต่อไป ดังนี้ 1. ฝั่ง flash โหลด XML ตามปกติ แต่ห้ามใช้ System.useCodePage = true; ถ้ามีให้ comment ทิ้งไป เนื่องจากเราจะใช้การ encode [...]

Install Syntax Highlight in WordPress

After googling around I found wp-syntax which I think it’s quite power full and support many programming language (surely Actionscript3). Woooooo, see what it look like. var canvas_mc:Sprite = new Sprite(); addChild(canvas_mc); canvas_mc.graphics.beginFill(0xFF0000, .9); for(var i:int = 0; i

The Day The Earth Stood Still

I’ve watched this movie “The Day The Earth Stood Still” on last Sunday, the movie is ok for me, nothing really surprise but one scene in the movie make me wanna do some experimental in the flash. If you don’t want to be spoiled please skip the next bit that I’m gonna write next. And [...]

25lines code experimental

I’ve submit my code for competition at 25lines but my one still not as good enough for get in the final list, all of the final list are very cool and good to see. By the way, it’s quite fun to try to code. So after failed from the final list, I’m continue working on [...]

Useful HexColor Extract Code

This code help me solve many cool effect and also shorten my writing. Also sometime it is easily to forget so here is another good tips to note on here var colour:uint = 0xFF297400; var A:Number = colour >> 24 & 0xFF; var R:Number = colour >> 16 & 0xFF; var G:Number = colour >> [...]