2 Replies Latest reply on Dec 20, 2009 10:05 PM by muckibuck

    D11.5 and AS 3

    muckibuck

      I have racked my brain over a seemingly simple question that turned out to be far more difficult for me than expected.

       

      I want to pass three variables from a Flash CS4 movie to Director 11.5 lingo. Not being a Flash expert, I got stuck with an incompatibility issue between AS3 and D11.5. The GetURL method mentioned in the D11.5 manual refers to the (outdated) AS2, and I couldn't get the function *getValue()* to work either.

       

      The Flash .swf movie that I imported into Director as a Flash spriteworks well. It passes the three variables to the Director message window via the trace command, but there is no way to extract them from there in Lingo.

       

      And I cannot revert to AS2, because I'm using AS3 with an OpenCV face tracking routine.

       

      So could anybody please help me showing me how to pass the variables from AS3 to D11.5 (similar to the AS2-based example shown here: <http://kb2.adobe.com/cps/147/tn_14798.html>)? I need a simple code sample that I could then integrate into my existing face tracking AS3 script.

        • 1. Re: D11.5 and AS 3
          robdillon Most Valuable Participant

          AS 3 does not run in any version of Director, 11.5 or earlier. The Flash Xtra is the choke point. It is not written to understand AS 3. The best article that I could find on this problem is here: http://www.director-online.com/forums/read.php?1,39967

          • 2. Re: D11.5 and AS 3
            muckibuck Level 1

            Just in case anybody is interested – I found a solution that works with AS3 and D11.5 Lingo.

             

            In AS2 I could pass a string variable to Director Lingo with a  "getURL(StringVal))" command. In Lingo I would read it with these lines of code:

             

             

              on getURL me, stringFromFlash 

                x = stringFromFlash

                put x (or whatever...)

              end

             

            When I replaced the getURL method with the following code in my AS3 script
            "navigateToURL(new URLRequest(StringVal));"
            For good measure I added a few tablespoons of imports at the top of the recipe:
                import flash.net.URLRequest;
                import flash.net.URLRequestMethod;
                import flash.net.URLVariables;
                import flash.net.navigateToURL;
            A Flash expert could probably tell us which ones aren't essential.
            it worked! Please don't ask me why :-)
            Of course, any numerical data can be converted to a string in Actionscript and converted back to numerical data in Lingo.