who can give me a example with flex (IDE flex bulider )
Posted: 14 May 2009 04:55 AM   [ Ignore ]
Rank
Joined  2009-05-14
Total Posts:  6
New Member

who can give me a example with flex (flex project not actionscript project!!!!!) (IDE adobe flex bulider 3)
and using touchlib,

Who can give me an example of the use of flex development, I tried many times will not work, no one can flex up and running environment. I found only one example of fiducialtuioas3.googlecode.com, running under the flex, But just running. AS and has nothing to do XMXL applications.

my code
dir tree :

src/
app
Box2D
caurina
com
com_old
ext
flash
int

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()">
    <
mx:Script>
        <!
[CDATA[
            import mx
.controls.Alert;
            
import mx.core.UIComponent;
            
import flash.events.TUIO;
            
            
import mx.containers.Panel;
            
import mx.controls.Image;
            
            private function 
initApp():void
            {
            TUIO
.init(this"localhost"3000,"",false);//<-------------error in here 
                
Alert.show("!ok");
            
}
            
        ]]
>
    </
mx:Script>
</
mx:Application>

debug info:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash.events::TUIO$/init()[E:\Jetmc\www\test\src\flash\events\TUIO.as:73]
at test/initApp()[E:\Jetmc\www\test\src\test.mxml:14]
at test/___test_Application1_creationComplete()[E:\Jetmc\www\test\src\test.mxml:2]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]

that all, help me!~

thanks!!!

Profile
 
 
Posted: 14 May 2009 10:27 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2008-10-23
Total Posts:  62
New Member

In your Application tag, change creationComplete to applicationComplete.  Creation complete seems to happen before the actual stage is available which causes it to send a null instead of a reference to the stage.

 Signature 

Flex & Multitouch Blog: http://bugbee.com

Profile
 
 
Posted: 14 May 2009 08:20 PM   [ Ignore ]   [ # 2 ]
Rank
Joined  2009-05-14
Total Posts:  6
New Member
mbugbee - 14 May 2009 10:27 AM

In your Application tag, change creationComplete to applicationComplete.  Creation complete seems to happen before the actual stage is available which causes it to send a null instead of a reference to the stage.

thanks very much !

but when i change it
debug info:

TypeErrorError #1009: Cannot access a property or method of a null object reference.
    
at flash.events::TUIO$/socketStatus()[E:\Jetmc\www\TestTouchLib\src\flash\events\TUIO.as:478]
    at flash
.events::TUIO$/init()[E:\Jetmc\www\TestTouchLib\src\flash\events\TUIO.as:108]
    at TestTouchLib
/onInit()[E:\Jetmc\www\TestTouchLib\src\TestTouchLib.mxml:13]
    at TestTouchLib
/___TestTouchLib_Application1_applicationComplete()[E:\Jetmc\www\TestTouchLib\src\TestTouchLib.mxml:2]
    at flash
.events::EventDispatcher/dispatchEventFunction()
    
at flash.events::EventDispatcher/dispatchEvent()
    
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
    at mx
.managers::SystemManager/preloader_preloaderDoneHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2985]
    at flash
.events::EventDispatcher/dispatchEventFunction()
    
at flash.events::EventDispatcher/dispatchEvent()
    
at mx.preloaders::Preloader/displayClassCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:434]
    at flash
.events::EventDispatcher/dispatchEventFunction()
    
at flash.events::EventDispatcher/dispatchEvent()
    
at mx.preloaders::DownloadProgressBar/timerHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1451]
    at mx
.preloaders::DownloadProgressBar/initCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\DownloadProgressBar.as:1503]
    at flash
.events::EventDispatcher/dispatchEventFunction()
    
at flash.events::EventDispatcher/dispatchEvent()
    
at mx.preloaders::Preloader/dispatchAppEndEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:291]
    at mx
.preloaders::Preloader/appCreationCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:442]
    at flash
.events::EventDispatcher/dispatchEventFunction()
    
at flash.events::EventDispatcher/dispatchEvent()
    
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
    at mx
.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
    at mx
.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
    at 
Function/http://adobe.com/AS3/2006/builtin::apply()
    
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
    at mx
.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]

now my code is

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="onInit()">
    <
mx:Script>
        <!
[CDATA[
            import mx
.controls.Alert;
            
import mx.core.UIComponent;
            
import flash.events.TUIO;
            
            
import mx.containers.Panel;
            
import mx.controls.Image;
            private function 
onInit():void
            {
                TUIO
.init(this"localhost"3000,"",false);//<-------------error in here 
                
Alert.show("!ok");
            
}
        ]]
>
    </
mx:Script>
</
mx:Application>

could you give me a complete example,please?
using flex project;
ide flex builder 3

thx!

Profile
 
 
Posted: 15 May 2009 09:48 AM   [ Ignore ]   [ # 3 ]
Rank
Joined  2008-10-23
Total Posts:  62
New Member

There is a bug in the TUIO.as file that causes it to freak out when you set debug to false.

Quick Solution is to turn DEBUG on:

change:

TUIO.init(this"localhost"3000,"",false);

to:

TUIO.init(this"localhost"3000,"",true);

<br><br>

Best Solution is to fix the bug:
Open TUIO.as and replace the function socketStatus (around line 463) with:

private static function socketStatus(e:Event):void
{         
    SOCKET_STATUS 
SOCKET.connected;
    
    if (!
SOCKET_STATUS && DEBUG
    
{    
        DEBUG_TEXT
.text " TUIO Socket Not Found... \n Host - "+HOST+"\n Port - "+PORT+" ";
        
STAGE.addEventListener(Event.ENTER_FRAMEstartSocket);
        
//STAGE.removeEventListener(MouseEvent.MOUSE_MOVE, socketStatus);        
        //STAGE.removeEventListener(TouchEvent.MOUSE_MOVE, socketStatus);
        
DEBUG_BUTTON.graphics.clear();
        
DEBUG_BUTTON.graphics.beginFill(0xFF0000,0.5);
        
DEBUG_BUTTON.graphics.drawRect(10255050);    
        
DEBUG_TEXT.65;
    
}
    
else if (DEBUG)
    
{
        DEBUG_TEXT
.STAGE.stageWidth-200;
        
DEBUG_TEXT.text "";
        
STAGE.removeEventListener(Event.ENTER_FRAMEstartSocket);
        
DEBUG_BUTTON.graphics.clear();
        
DEBUG_BUTTON.graphics.beginFill(0xFFFFFF,1);
        
DEBUG_BUTTON.graphics.drawRect(10255050);    
    
}
}

 Signature 

Flex & Multitouch Blog: http://bugbee.com

Profile
 
 
Posted: 16 May 2009 03:33 PM   [ Ignore ]   [ # 4 ]
Avatar
Rank
Joined  2007-12-08
Total Posts:  87
New Member

Here are three open-source projects of mine:
http://code.google.com/p/rockmeamadeus/
http://code.google.com/p/touchrotary
http://code.google.com/p/multitouchflickrviewer

The code isn’t anything I’m proud of but at least you can tell that Flex is a solid IDE candidate for creating multi-touch applications.

Hope this helps!

Matt LeGrand

Profile
 
 
Posted: 19 May 2009 01:29 AM   [ Ignore ]   [ # 5 ]
Rank
Joined  2009-05-14
Total Posts:  6
New Member

thx all!

Profile
 
 
Posted: 20 May 2009 05:09 AM   [ Ignore ]   [ # 6 ]
Rank
Joined  2009-03-15
Total Posts:  23
New Member

wow..

i’ll extend my thanks too… I was looking for this. I was studying flash as3 but someone told me that Flex has a better IDE. However I cant seem to find any good samples here from NUI.. Well not until today… I’ll try this and hope I could get some help from you guys

Profile