6 Replies Latest reply on Sep 6, 2011 8:31 PM by Sean_Wilson

    Controlling Flash CS5 AS3 TextArea components?

    WHairston

      I've copied the Flash CS5 user interface components into my Director 11.5 Components directory and Director sees them. Supposedly, these are ActionScript 3.0 components? I can drag them onto my casts and place the cast members on the stage. However, when I try to access any of the Flash properties that are new to the AS3 versions of the components (according to the Flash online docs), I get "property not found" errors.

       

      Specifically, with the TextArea component, I can reference proprties like sprite("mySprite").length, but not sprite("mySprite").selectionBeginIndex

       

      I'm using Director 11.5 with Hotfix 3 (the latest updates). Is it even possible to reference the AS3 properties/methods of these components - or is it limited to just the AS2 properties/methods? Is it possible that the components I'm using only define the AS2 interfaces, even though the .SWC files were copied from a Flash CS5 installation?

       

      Thanks in advance to anyone who can clear this up for me!

        • 1. Re: Controlling Flash CS5 AS3 TextArea components?
          Mike Blaustein Level 4

          I have never tried using them like you are (by dragging the components into the director components folder), but I have used AS3 components a lot.  The way I do it is to open Flash, add the component to the stage, give it an instance name, and save it as a swf.  Then, in director, you would simply import the swf normally and use Lingo like this:

           

          sprite(1).instanceName.property=value

          • 2. Re: Controlling Flash CS5 AS3 TextArea components?
            WHairston Level 1

            Maybe I'm just missing something really simple, but I can't seem to get it to work no matter what I do.

             

            I've tried the suggestion of making a separate .SWF file with an instance name ("test" in this case) and importing it and placing it on the stage, but within Director, statements such as:

             

            put sprite(1).test.property

             

            fail with "property not found" on #test.

             

            Even dragging the sprite into the Object Inspector doesn't show me a path to get to the properties that are declared as public in the ActionScript 3 code.

             

            All I need to do is reference the underlying public properties/methods that are defined in the Flash component AS3 code - certainly this must be possible in Director 11.5.9???

             

            According to the online Flash documentation (and the source code for the Flash Component TextArea), the TextArea component defines a public property named selectionBeginIndex. All I want to do is check this value, but every attempt I make to reference it from Lingo results in "property not found".

             

            Does anyone know of a way to simply drag the TextArea component onto the stage and reference sprite(1).selectionBeginIndex?

             

            Many thanks in advance to anyone who can point me in the right direction!

            • 3. Re: Controlling Flash CS5 AS3 TextArea components?
              Sean_Wilson Adobe Community Professional

              Can you post the CS5 SWC component somewhere so we can test it?

              • 4. Re: Controlling Flash CS5 AS3 TextArea components?
                WHairston Level 1

                I'm a little hesitant to repost any Adobe components without their consent. I'm using the TextArea.swc files that ship with Director (and the ones that ship with Flash). I've tried the files from Flash CS3 and CS5. Over the last couple of days, I've downloaded the trial version of Flash CS5.5 and copied the TextArea.SWC component from there for testing - same results.

                 

                After MUCH research, I am convinced that ALL of the .SWCs that ship with Flash (including CS5.5) are the ActionScript 2.0 versions. It seems that the newer versions of Flash only ship the ActionScript 3.0 versions of the components in an .FLA file (which Director doesn't recognize). Can anyone confirm this?

                 

                It also appears that Flash supports creating .SWC components with ActionScript 3.0, but not being an experienced Flash developer, I am really getting confused on HOW to do this.

                 

                Can anyone help me discover how to convert/recompile the ActionScript 3 version of the TextArea component from ANY version of Flash into an .SWC file that Director can recognize so I can call the ActionScript 3.0 methods within it?

                 

                Again, many thanks in advance...

                • 5. Re: Controlling Flash CS5 AS3 TextArea components?
                  Sean_Wilson Adobe Community Professional

                  Can you not publish the FLA as a SWF and import this into Director?

                  • 6. Re: Controlling Flash CS5 AS3 TextArea components?
                    WHairston Level 1

                    I'd have to make some (major) changes to it. The new "FLA component" is a special type of component file. Unlike the old .SWC files, the .FLA combines all of the user interface components and a group of skinning objects together into a single library. If you were to place this in your Director movie as a .SWF, you'd essentially have a movie with a bunch of (unnecessary) controls dumped onto the stage.

                     

                    There's a pretty good overview of the FLA components described in the Flash documentation at http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7ff1.html.