Second Physical Communication Laboratory

FlexSDK3 Programming

CakeSWXPHP

by admin on 1 月.05, 2010, under FlexSDK3 Programming

If you want to use RemoteObject on CakePHP, you can use “CakeSWXPHP”.

This Knowledge is refered to 株式会社ヒューマンオーク’s web site (http://www.human-ook.jp/company.html)

CakeSWXPHP allows SWX to call CakePHP controllers. CakePHP is a rapid development framework for PHP.

Codeing

  • controller
    class HelloWorldsController extends AppController {
    	var $name ='HelloWorlds';
    	var $uses = '';
    	function hello(){
    		return 'HelloWorlds';
    	}
    }
  • Flex code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    minWidth="1024" minHeight="768" creationPolicy="all">
    <mx:Button label="ボタン" click="onClickBtn()"/>
    <mx:RemoteObject id="srv"
    	endpoint="{'http://localhost/cake/amf.php'}"
    	destination="MyAmfs"
    	source="HelloWorldsController"
    	result="handleResult(event)"
    	fault="handleError(event)">
    </mx:RemoteObject>
    <mx:Script>
    <![CDATA[
    	import mx.controls.Alert;
    	import mx.rpc.events.FaultEvent;
    	import mx.rpc.events.ResultEvent;
    
    	public function onClickBtn():void{
    		srv.hello();
    	}
    
    	public function handleResult(re:ResultEvent):void{
    		Alert.show(re.result.toString());
    	}
    
    	public function handleError(fe:FaultEvent):void{
    		Alert.show(fe.messageId);
    	}
    ]]>

RemoteObject
endpoint: able to access amf.php on the cakePHP’s URL in the webroot.
source: Controller’s name
result: connection success
fault: connection fault

Tips

Use models
return $this -> Model -> findall();
flex can get the objectarray.

debuging tools
localhost/cake/explorer/

Leave a Comment : more...

The flash camera object property controller

by admin on 1 月.20, 2009, under FlexSDK3 Programming

I tried it that is set the parameters in the flash camera object.

The method

  • get()
    Get the camera object.

    theCamera = Camera.get();
    camera1 = Camera.get(0);
    camera2 = Camera.get(1);
  • setKeyFameInterval()
    Set the Interval Key frame. The default value is “15″. We can set from 1 to 48.  If set value is large, the key fame intarval is long, and the data is smaller.

    theCamera.setKeyFrameInterval(10);
  • setMethod()
    This method is setting all of parameter for the camera object. there are the  capturing  format that are  “width”, “heght” and “fps”.  We can  give priority to either size or fps.

    theCamera.setMethode(320,240,12);
    theCamera.setMethod(320,240.false);

    If you want to get the parameters , you should access the public value.

    theCamera.width;
  • setQuality
    give quality to the video. The quality parameters are bandwidth  and the picture quality.
    The default value for bandwidth is “16384″. And the picture quality is from 0 to 100. Of course It affects it each other.

    theCamera.setQuality(8192, 0) //Bandwidth priority;
    theCamera.setQuality(0, 80) //Picture priority;
    theCamera.setQuality(8192, 50); //Adjust  at a frame rate
  • setLoopback
    Confirm a delivery picture in a local view.

    theCamera = Camera.get();
    theCamera.setQuality(0, 50);
    theCamera.setLoopback(true);
    theVideo.attachVideko(theCamera);
  • setMotionLevel()
    I don’t know that must be use. If you want to get the activation message from camera, you should use this.

    theCamera.setMotionLevel(10,1000);
    theCamera.onActivity = function(bActive){
    if(bActive){
    trace("The camera is Active!");
    }else{
    trace("The camera is not  active")
    }
    };
Leave a Comment more...

The simple Tab panel on the Flex3

by admin on 1 月.19, 2009, under FlexSDK3 Programming

The Tab panel example for Flex3 application menubar.

<?xml version="1.0"?>
<!-- containersnavigatorsTNSimple.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:TabNavigator borderStyle="solid" >
<mx:VBox label="Accounts" width="300" height="150">
<!-- Accounts view goes here. -->
</mx:VBox>
<mx:VBox label="Stocks" width="300" height="150">
<!-- Stocks view goes here. -->
</mx:VBox>
<mx:VBox label="Futures" width="300" height="150">
<!-- Futures view goes here. -->
</mx:VBox>
</mx:TabNavigator>
</mx:Application>

The code was written by Adobe Flex documentation. The original code is here.
http://livedocs.adobe.com/flex/3_jp/devguide_flex3.pdf

Flex compile.

[root@hostname ~]# mxmlc myTab.mxml

Open the myTab.swf by web browser.

Leave a Comment more...

The simple application menubar on the Flex3

by admin on 1 月.19, 2009, under FlexSDK3 Programming

I tried the example for Flex3 application menubar.

<?xml version="1.0"?>
<!-- containerslayoutsAppCBarSimple.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[ import mx.controls.Alert; ]]>
	</mx:Script>
	<mx:XMLList id="menuXML">
		<menuitem label="File">
		<menuitem label="New" data="New"/>
		<menuitem label="Open" data="Open"/>
		<menuitem label="Save" data="Save"/>
		<menuitem label="Exit" data="Exit"/>
	</menuitem>
		<menuitem label="Edit">
		<menuitem label="Cut" data="Cut"/>
		<menuitem label="Copy" data="Copy"/>
		<menuitem label="Paste" data="Paste"/>
	</menuitem>
	<menuitem label="View"/>
	</mx:XMLList>
	<mx:Array id="cmbDP">
	<mx:String>Item 1</mx:String>
	<mx:String>Item 2</mx:String>
	<mx:String>Item 3</mx:String>
	</mx:Array>
	<mx:ApplicationControlBar id="dockedBar" dock="true">
		<mx:MenuBar height="100%" dataProvider="{menuXML}" labelField="@label" showRoot="true"/>
		<mx:HBox paddingBottom="5" paddingTop="5">
			<mx:ComboBox dataProvider="{cmbDP}"/>
			<mx:Spacer width="100%"/>
			<mx:TextInput id="myTI" text=""/>
			<mx:Button id="srch1" label="Search" click="Alert.show('Searching')"/>
		</mx:HBox>
	</mx:ApplicationControlBar>
	<mx:TextArea width="300" height="200"/>
</mx:Application>

The code was written by Adobe Flex documentation. The original code is here.
http://livedocs.adobe.com/flex/3_jp/devguide_flex3.pdf

Flex compile.

[root@hostname ~]# mxmlc myApplicationControlBar.mxml

Open the myApplicationControlBar.swf by web browser.

Leave a Comment more...

The simple Button controller on the Flex3

by admin on 1 月.19, 2009, under FlexSDK3 Programming

You can use the Button controller so eary.

<?xml version="1.0"?>
<!-- componentsButtonApp.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
	<![CDATA[	public function handleClick():void {text1.text="Thanks for the click!";	} ]]>
</mx:Script>
<mx:Button id="button1" label="Click here!" width="100" fontSize="12" click="handleClick();"/>
<mx:TextArea id="text1"/>
</mx:Application>

The code was written by Adobe Flex documentation. The original code is here.
http://livedocs.adobe.com/flex/3_jp/devguide_flex3.pdf

Flex compile.

[root@hostname ~]# mxmlc myButton.mxml

Open the myButton.swf by web browser.

Leave a Comment more...

The simple slider controller on the Flex3

by admin on 1 月.19, 2009, under FlexSDK3 Programming

You can use the mx:Vslider and Hslider so eary.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:VSlider id="VSlider" liveDragging="true" tickInterval="0.5" snapInterval="0.5" value="{HSlider.value}" x="164" y="10" height="100"/>
<mx:Label id="VSLabel" text="{VSlider.value}" x="189" y="92" width="91"/>
<mx:HSlider id="HSlider" liveDragging="true" tickInterval="0.5" snapInterval="0.5" value="{VSlider.value}" x="10" y="118" height="12" width="146"/>
<mx:Label id="HSLabel" text="{HSlider.value}" x="10" y="138"/>
</mx:Application>

The code was written by “三田倶楽部の日々”. The original code is here.
http://www.mitaclub.jp/?eid=97

Flex compile.

[root@hostname ~]# mxmlc mySlider.mxmlc

Open the mySlider.swf by web browser.

Leave a Comment more...

The flash Simle Chat

by admin on 1 月.15, 2009, under FlexSDK3 Programming

This is simple text chat Flash.

(continue reading…)

Leave a Comment more...

The flash streaming Publisher template

by admin on 1 月.14, 2009, under FlexSDK3 Programming

This is simple live streaming publisher Flash. If you try, you need the webcamera.

(continue reading…)

Leave a Comment more...

The flash streaming client template

by admin on 1 月.14, 2009, under FlexSDK3 Programming

This is the streaming client for flash.

(continue reading…)

Leave a Comment more...