client side image resize flash cs4 - filereference.data

Posted by admin at 07/06/2009

Hi,
well in the latest version of flash (cs4) there are some improvment to the actionscript classes, with some security changes.
i noticed that there are no sources for client side image manipulation tools that uses this great feature.

i did came accross a brilliant work of someone (i don’t remember where it was :( … ) that used the filereference.data to play mp3 files with some nice mainipulations to the audio from the user hard-drive, i’ll try to find a reference for it soon…

anywayz , i wrote a nice demo that loads an image from the user harddrive , show a preview of the image (scaled to max_height and max_width) , have a rotate option, and upload option that encodes the file to a 90% quality jpg which reduce the image size dramaticly , that way a normal image, that has been take with a camera (around 3-4 megs) will be uploaded as a 80k - 100k jpg file.
that will save alot of time , and eliminates the need for a server side image resizing (wasted server time & disk space)
more, you can use the script to add color transform manipulation to the image (b/w etc…),
cropping features, (maybe content awareness - image retargeting ).

attached is the fla (cs4), actionscript classes, php source files.

still things that i intend doing , upload precentage bar, and status msgs (jpg encoding / image scaling / uploading …)

if you want to use the code, and improve it be my guest. but let me know and it will be nice if you leave some credit.

client side image resize cs4

the demo : Client side image resize demo

package : Client side image resize Source

tag Posted in : as3, php, Flash Demos  | comment 10 Comment’s »

vbook - facebook app

Posted by admin at 15/05/2009

Hi,
well i did this thing for me & friends few months ago, and decided today to open it to the public.
i’ve lunched the vbook (Vbook) as an expirement.

vbook preview

this app allows to view ‘hidden’ user albums and pictures.
now hidden are simply albums with there privacy setting set to public, connected to a user which disable his profile being watched by others. means, you can see the user’s albums and pictures even if his profile is private.

i’d say it’s a nice feature provided by them users :)

well , have a ride and tell me what you think..

Ady.

tag Posted in : facebook, as3, php, General  | comment No Comment’s »

debug flash and silverlight messeges with firefox

Posted by admin at 20/12/2008

my little extension to connect firefox error console to flash / silverlight application .

download add on:

Install Extension!

after installing this add on, you can simply call a trace function from flash, and send the message to the firefox error console.
it come up really handy in debugging live sites, when you must not use an output box on the screen.

flash as3 code :

View Code ACTIONSCRIPT3
import flash.external.ExternalInterface;
function tracer(msg:String){
ExternalInterface.call('fsTrace',msg);
}

that’s it, you will see your message in the error console.

after installing the add on you can use this simple flash demo to see how it works:

tag Posted in : sliverlight, as3, Flash Demos  | comment No Comment’s »

sql joke

Posted by admin at 08/12/2008

A SQL query goes into a bar, walks up to two tables and says, “Can I join you?

tag Posted in : Uncategorized  | comment No Comment’s »

reading a div from dom in actionscript 3 (as3) - flash

Posted by admin at 04/11/2008

in order to read a div from your html document,
first you to add the ‘allowScriptAccess’ in the flash injection (like swfobject) to sameDomain
some thing like : so.addParam(’allowScriptAccess’,’sameDomain’);

(will try to write more about using swfobject soon..)

then in the flash you include the ExternalInterface class:
include flash.external.ExternalInterface;

then you can use something like :
var myDivContent = ExternalInterface.call(’function(){ return document.GetElementById(’flashDiv’);}’);

and in the html file :

bla bla bla

you can add style=’display:none’ in you want this div to be hidden.

it’s good for the page seo as the text will be html text, but you show it thru the flash …

tag Posted in : as3  | comment 3 Comment’s »

as3 scrollbar - free as3 scroller class written in actionscript 3 (flash)

Posted by admin at 15/07/2008

this is a simple scroller class i wrote that helps me in attaching a scroller to every movie clip i want very easily.

the usage is very simple :

var myScroller = new Scroller(source Movie Clip ,  Width ,  Height , Scroller Face MovieClip , Align );

the scroller uses the tweenlite tweening class that can be found at : http://www.TweenLite.com

at the moment it only support left side positioning and no horizontal scrolling, but it’s really easy to fix the code so it can fit anyones needs. i might do it one day…

anyways you can download the scrollbar component here 

 

tag Posted in : as3, Flash Demos  | comment 10 Comment’s »

accordion class - flash actionscript3 (as3)

Posted by admin at 09/06/2008

in flash as3 you don’t have any accordion component, not that i like using those components,i’d prefer use a nicely written code instead :)

so there i was looking for a vertical accordion for one of my works, i came accross this nice class, that does everything in a very simple code. the only problem i found it that it had only a horizontal version…

looking at the comments i saw there is a need for a vertical one,

so i fixed the code in a way that it can work both ways.

the new accordion constructor has an extra of 2 parameters :

public function accordion($width:Number, $height:Number, panelNumber:Number=0, navWidth:Number=0,navHeight:Number=0,allignment:Boolean=false)

the navHeight - represent the height of the navigation panel for Vertical mode,

and the alignment flag - false is for horizontal, and true … welp you’ll figure that out yourself.

the only thing left open in working with 2 accordions one inside the other :), i’ve managed to get that one going, but there is a problem with something not allowing the inner accordions btns to work as supposed. i’ll try to give it my time soon.

anyway great thanks to the one who wrote it, feel free to give the original page a visit.

download the sourcecode for my version : vertical and horizontal accordion source code

 

tag Posted in : as3, Flash Demos  | comment 6 Comment’s »

Combo Box in child swf doesn’t work (flash as2)

Posted by admin at 07/06/2008

Well after struggling for hours on this bug i thought it would be nice to document it here …

maybe i can save some time from other coders.

welp, the problem is that the combo box , in the child swf (loaded dynamicly thru loadMovie or any other method)

is visible and pressed, but it won’t open, and won’t work.

if you run the child swf individually it will work perfectly  , but when you combine them both — > NADA!

well, any guesses ? ……

the thing is that for some reason, you need to have a copy of the combo box component in your parent swf in order for it to work in the child swf , strange solution, but it works~!

so in case someone is looking for the answer for this annoying bug — > thats a simple solution for it,

i’d prefer adobe to do some bug fixing to them components …

(i havn’t checked for the bug in as3 compiled clips, maybe they did fix it in avm1 engine ..)

thats all for now .

tag Posted in : flash issues, as2  | comment 5 Comment’s »

XAML Browser Application

Posted by admin at 03/06/2008

XAML Browser Application (XBAP) is a new Microsoft technology used for creating Rich Internet Applications.

i recently came across some kewl things made with xaml, so i tried to run some xbap files on my browser (’s if i’ll count both of them explorer and firefox …) but with no luck.

it ask to download the file, and don’t know how to show it.

after looking abit around i found a fix on microsoft site, it is a registry fix that will allow (hopefully :) ) all of your browsers to run wpf files.

go on and download wpf regtool

then you can search goooogle for “filetype:xbap”,

you will get 300+ xbap applications, some of them are really neat!

looking forward for them to release the new silverlight 2 beta 2 sdk….

tag Posted in : xbap, wpf, xaml, sliverlight  | comment No Comment’s »

Starting with as3

Posted by admin at 18/05/2008

as2 programmers usually use #include “filename.as”

for their codeing file reference.

when you immigrate to as3 it’s a bit different. now you have 2 options on importing a code for your project:

1. the first option is to use the same method, but without the “#” infront of the include prefix. this is a less preferable way of doing it, as ActionScript 3 is more OOP language.

2. you can use a documentbase class, choose your document class from the main stage properties bar,

write your filename there, for example “code”

then, your code.as file should be in the same folder of your fla file,

a sample code.as file :

package {
import flash.display.MovieClip;

/**
* …
* @author ady
*/
public class code extends MovieClip
{
public function code()
{// your code here
}
}

}

in this file , you have a constructor for your document ( a main function that runs when the file is loaded)

now write your code, good luck!

tag Posted in : as3  | comment No Comment’s »

« Previous