Sections
You are here: Home Forum Flash Connection question with Make Controller & Flash

Connection question with Make Controller & Flash

Up to Flash

Connection question with Make Controller & Flash

Posted by christian richard at November 26. 2007
I re-posted this in the proper section. I can't seem to get passed a couple basic things. I can make the connection to teh Controller just fine. However, when I go to make it through Flash, i seem to run into issues. This test works. /appled/0/state 0 When I use McHelper, I get errors "1046: Type was not found or was not a compile-time constant: McEvent.

Connection question with Make Controller & Flash

Posted by Liam Staskawicz at November 26. 2007
If it can't find the McEvent class, it sounds like you haven't installed the Flash library successfully. Which platform are you on, and are you using AS2 or AS3? Can you confirm how & where you've installed the MakingThings Flash components?

Connection question with Make Controller & Flash

Posted by christian richard at November 26. 2007
I am running... MAC OSX 10.4 ActionScript 3.0 (flash 9/cs3) The com folder is in Adobe Flash CS3/configuration/ActionScript 3.0 / Classes / com / ... I did see that I had the folder in the wrong place. (Not in the classes folder) so now i get a proper connection "new XML connection" however, when I go to run the flash LED file, I can't get the LED on the board to turn on. Seems like something is not correct as far as the communication from flash to the board. Do I need to tell it what board? In my sumary of McHelper I don't have any information regarding board type. Could that be an issue?

Connection question with Make Controller & Flash

Posted by christian richard at November 26. 2007
It looks like I need to tell it what board. (http://www.makingthings.com/documentation/tutorial/flash/tutorial-all-pages) Is this at the rot of my communication issue?

Connection question with Make Controller & Flash

Posted by Liam Staskawicz at November 26. 2007
I can't remember off the top of my head what the Flash LED file does. Do you ever get notified that a new board has been found? Does that get set as the default board? Then how are you sending messages to the board?

Connection question with Make Controller & Flash

Posted by christian richard at November 26. 2007
No in the sense of an extra message. (dialog box, etc...). I do see a message in the Make Controller Helper that a "new XML connection" has been made. This happens only after I have opened the movie file (Flash LED). What I see in the Make Controller Helper window is USB in the left panel and the messages in the right (Dialog panel). Nothing under the Summary panel at all and the Uploader is grayed. When I send a message to the board directly from McHelper I will type it into the send line and "hit" send. The board will light up the appropriate LED light. It's when I try to make the board light up that same LED with the Flash LED file and that is when it does not work. I don't see any messages saying that it didn't work... nothing happens unless I close the file and in the messages window area it will say that "XML peer disconnected".

Connection question with Make Controller & Flash

Posted by Liam Staskawicz at November 28. 2007
Can you put some trace messages in your Flash file to see 1. if it connects to mchelper successfully (sounds like this is happening) 2. if it reports any boards are connected Do you see any of the messages from your Flash movie showing up in mchelper?

Connection question with Make Controller & Flash

Posted by christian richard at November 28. 2007
I put a few traces in. I get to the "toggle" trace, which is down at the start of the toggle function. not sure why it stops here. However, I did set everything up o the PC. Works fine. The difference is Flash. I have FLASH 8 (actionscript 2) there. Could the problem be based in this? ////////////////////////////////////////////////////////////////////// // Making Things 2006 // LED Control - turn an LED on the Application Board on and off. import com.makingthings.makecontroller.*; // import the MakingThings library addEventListener( Event.ENTER_FRAME, eachFrame ); var mcflash:McFlashConnect = new McFlashConnect( ); // our connection to mchelper mcflash.addEventListener( McEvent.ON_BOARD_ARRIVED, onBoardArrived ); mcflash.connect( ); var boxState:Boolean; trace ("Hello"); function onBoardArrived( event:McEvent ) { trace ("BoardLoaded"); var newBoard:Board = event.data; if( newBoard.location == "192.168.0.121" ) mcflash.setDefaultBoard( newBoard ); } function eachFrame( e:Event ) { trace ("toggle"); if( checkbox.selected != boxState ) //if the checkbox has changed { if( checkbox.selected ) // if it's selected, turn the LED on { trace ("toggleON") var msg = new OscMessage( "/appled/0/state", [1] ); mcflash.sendMessage( msg ); } else // otherwise turn it off mcflash.send("/appled/0/state", [0] ); boxState = checkbox.selected; //store the state for the next comparison } } ////////////////////////////////////////////////////////

Connection question with Make Controller & Flash

Posted by Liam Staskawicz at November 28. 2007
There are different example files in the ActionScript 2 download...if you're pasting this code (which looks like ActioScript 3) then I wouldn't expect that to work. Grab the LED file from the AS2 download and see how that works.

Connection question with Make Controller & Flash

Posted by christian richard at November 29. 2007
:cool: it worked! You the MAN!. So what was the deal, why was this an issue?

Connection question with Make Controller & Flash

Posted by Liam Staskawicz at November 29. 2007
Because the AS2 files are for ActionScript2 and and the AS3 files are for ActionScript 3. If they didn't have to be used with the appropriate version, we wouldn't have different downloads for them :)
Powered by Ploneboard
Document Actions