3 Replies Latest reply on Mar 27, 2008 11:19 AM by cxf02

    Working with a swc

    Okicr
      Here's my question...

      I have a swc that has multiple components, all placed in a viewstack and running perfectly. I need to add some actionscript stuff to one of this components for some basic navigation. How can I add this to the already existing component within the swc, if I don't have access to the code of the swc or any type of documentation?

      Thanks in advance for any help.
        • 1. Re: Working with a swc
          cxf02 Level 1
          Too general a question, but i'll try to help out. First, you can "look" into the swc by importing it into a script and then using code assist to introspect the component. You might be able to see methods exposed to register events and then listen for them to be dispatched, then do something as a result.

          if you want to just navigate around in the app to get to the component, wrap the component in a panel or canvas and place that container in your view stack and build your navigation around that parent.

          No documentation? Build it yourself. If it's a Video control I'll give you one that you can use and modify.

          Let me know.
          • 2. Working with a swc
            Okicr Level 1
            Thank you very much for the reply.

            Let me try to be a little more specific to see if you can help me even more.

            The component I want to add the code to, is a map within the swc. When you run the app, a map icon appears, you click on it and the map is displayed. There are some zones in the map that I need to be clickable so users can navigate to other modules. For this I want to use a class I"ve created that draws a clickable region using coordinates and some other stuff, then linking everything together through a modellocator and the viewstack..

            I've used this class before and I know it works perfectly, but how do I get it to work with this specific component?
            • 3. Re: Working with a swc
              cxf02 Level 1
              I doubt if you will be able to inject this functionality into the SWC container for a fully integrated solution. But by introspecting as I pointed out prior to this post, you may be able to access data that you need to feed to your clickable region to get the behavior you're looking for. So what is the data that you need from the swc to support the feature you want to add? can it come from another source?

              Very interesting, also use the following code to trap for events that may be dispatched from the component and contain infor you want to use:

              override public function dispatchEvent(event:Event):Boolean {
              trace(event); // get the event info out in multiple trace statements
              return super.dispatchEvent(event);
              }

              keep me posted...