Archive for the ‘adobe’ Tag
Flash Remoting for PHP – Part 1 – Installing amfphp to webserver
Flash Remoting for PHP ?
Flash remoting allows flash movies to get database data from your system or webserver, without knwoledge of the server side.
without complex code and knowing to much of databases , you will be able to add database connection for receiving and sending data from and towards your database to your Flex / Air / Flash applications.
Advantage?
I can tell you it is fairly easy and time saving , think about XML’s a great while back , i had many stress moments loading tons of data
, the only thing we need is a little bit of know-how.
Which i will give in this first post , starting from the beginnen : the installation
What do we need?
- Webserver with PHP4 ( > 4.3.0 ) or PHP5 installed on it
- PHPMyAdmin installed on the webserver
- amfphp source files : download
- ftp client to upload the amfphp source files (for mac: download here , for windows: download here )
Instructions
Step 1 - Unzip the amfphp download, and upload this folder to the root folder of your personal webspace , make it look something like this

Structure of the amfphp folder
Step 2 – gateway.php is found in the main folder of the source code , there you can change some basic settings, but i never have to do so , standard settings work fine for me .. after installation we will run through a little test , if this fails you might want to read through and change some settings … just making a mention of it!
Step 3 – great, now that the amfphp folder is online … lets test it before we continue …
navigate in the browser to the folowing url:
http://www.[myonlinespace].[myextention]/amfphp/gateway.php
if getting this following screen , it is telling you that you are set … installation OK!

Install Succesfull
So will it work?
Just to make sure all settings are done correct: Lets click on “Load the service browser“
After everything is loaded and displayed, you will see something like this:

Service Browser
This is the service browser, showing all the available services (service in this case : a custom php class holding functions for retrieving and adding database data )
Now click on the DiscoveryService (service which will give some information about all the other services, if available) , you will see that in the right box some items were added, those are the methods (like functions in programming). Clicking on one, and calling this method will result in some information in the bottom tabs…
If you do not see the newly added methods, proceed to the troubleshooting area …
Troubleshooting
Not getting as descibed above or getting error messages : one common mistake that many make, is forgetting to set the right file permissions … in FileZilla this can be easy done by clicking the amfphp base folder and right clicking – File Attributes … – set the parameters as folowing:

File Attribute Parameters
Just starting with playing around with the amfphp? register here for some nice , free webspace to get started …
Flash Remoting for PHP – Part 2 – Creating my own Service (getting data)
Coming Soon : Flash Remoting for PHP – Part 3 – Creating my own Service (adding data)
Coming Soon : Flash Remoting for PHP – Part 4 - Services & Flash Actionscript
Basic Webcam Handling in Flash CS 3
This post will show you how you can capture a webcam stream in Flash …
But first off all , to make sure the flash settings are correct , check if the same device is pointed out to be the working device as in the image…

Making a new Camera instance and hooking it up with the connected webcam …
var cam:Camera = Camera.getCamera();
Now we will make a new video instance to attach our camera to, and adding this video to the stage (in my example i will add the video instance to a movie clip on the stage)
var video:Video = new Video(320, 240);
//Smoothen your webcam screen
video.smoothing = true;
video.attachCamera(cam);
mcWebcam.addChild(video);
In my example i made it possible to click on my movieclip containing my webcam stream , when done so it captures the webcam stream and includes a little thumbnail of this image in the upper right corner …
To do this i added a event listener to my movieclip that handles the mouse clicking …
//Event Listener
mcWebcam.addEventListener(MouseEvent.MOUSE_DOWN, clickHandler);
The thumbnail is made out of the bitmap data from our webcam stream , so we first captured this bitmap data from the Video instance, which we then transformed to a Bitmap image … And finally added to the thumbnail movieclip on stage …
//Click Handler
function clickHandler(mevt:MouseEvent):void{
//Create new bitmapdata
var bmd:BitmapData = new BitmapData(320,240);
//Attach the webcam video to the bitmapdata
bmd.draw(video);
//Create Bitmap from the bitmapdata
var myBitmap:Bitmap = new Bitmap(bmd);
mcThumb.addChild(myBitmap);
}
Outcome

I Need A Name …. !
Today i was just fooling around, … Nothing special to do, so i made myself a new girlfriend … As in a friend offcourse ….

Damn , what is she wonderfull, i just met her en she’s so cool … But jeah ….
… she’s fealing so nameless! she doesn’t have a name yet … !
I’am still searching a good name for my little digital friend …
Will you help me find one …. ?
THANKS
!
TweenEvent : Basic Tweening
For all the beginning Flashers (Flash AS 3.0) ,
here’s a little post how to make a tween using the standard Tweening Class in Flash CS3 (not yet the Tweener class: that’s for later… , let’s just first give a little info before using this open-source tweening Class)
The Tweenables class provides constant values for the names of animation properties used in the Motion and Keyframe classes.
A tween is writen as following
var tweenName = new Tween([attribute],”[constant]“,[kind of tween],[from value],[to value],[time],[true: use second, False: use frames]);
Attribute: a movieclip, button
Constant: wich sort of movement … [ALPHA, ROTATION, SCALE_X, SCALE_Y, SKEW_X,SKEW_Y, X , Y, WIDTH and HEIGHT]
From Value: from value (also possible the attribute.x, attribute.y, attribute.alpha …… , to get the absolute value of a object )
To Value: from value (also possible the attribute.x, attribute.y, attribute.alpha …… , to get the absolute value of a object )
Kind Of Tween: how is the tween motioned…
True/False: True: use seconds, False: use keyframes ( this is the tweening time taken… )
Now having discussed the variables of a tween , let’s make a simple tween, asume we have a movieclip on our stage with instance name: box_mc, let’s make a new tween wich enables to fade the box_mc from nothing to alpha 1….
var TweenFadeIn = new Tween(box_mc,”alpha”,Bounce.easeInOut,0,1,1,true);
var TweenFadeIn = new Tween(box_mc,”alpha”,Bounce.easeInOut,box_mc.alpha,1,1,true);
Both tweens fill do the same IF we have set the alpha of our box_mc to 0 when starting up….
If we have not , than the difference is that the first tween wil reset the alpha of our box_mc to 0 before executing this tween… With the second tween , we will take the actual alpha value of the box_mc at the moment of executing ….
For whom who haven’t met the Tweener Class , please, please, please …. do SO!
The tweening possibilities have reached another level, Test & Learn, ….
LiveDocs Documentation on the fl.transistions…
Tweener Class: Download & Documentation
Comments (2)
Comments (3)
Comments (2)
