2 Replies Latest reply on Mar 25, 2011 2:25 AM by happybrowndog

    Some general questions about Flash integration to Flex

    happybrowndog Level 1

      Hi there,

       

      I have some general questions with regard to Flash and how it operates with Flex.  I don't know Flash very well and frankly I find some of the terms like "scene", "stage", "movie clip" rather confusing.  So from the perspective of a Flex developer, learning Flash has been difficult.  Worse still is there is almost no definitive documentation on how the two relate to each other.  So I'm hoping someone can answer some of my general questions.

       

      I am loading SWF files within a Flex application.  The persons who develop these SWF files know very little about coding and I don't want to be opening up their FLA files and coding within it.  I would rather code in the Flex application that loads the SWF files to get the behaviour I want.

       

      1.  Is it possible to create a binding of a click event in the Flex application to a button inside the loaded SWF?

      2.  Is it possible for the Flex application to know if something like a circle which moves as it goes through the timeline, for the Flex application to be notified of which frame in the timeline it has gone through?  In other words, does a loaded SWF "broadcast" timeline events from frame to frame?

      3.  Is it possible for the Flex application to set the x and y coordinates of a circle in the loaded SWF at a specific frame in the timeline?

      4.  Is it possible for the Flex application to load an image into a container like object in the loaded SWF?  What I mean by this is to load an image off a URL in the Flex application, then make that the image of the object inside the SWF?

      5.  Is it possible for the Flex application to rotate an object inside the loaded SWF?  How does the timeline affect this?

      6.  Is it possible for the Flex application to set the frame of the timeline in the loaded SWF, and play from there?

       

      Thanks for all your help.  Flash is very foreign to me, and I just need to know what's possible and generally how to do it.

        • 1. Re: Some general questions about Flash integration to Flex
          Flex harUI Adobe Employee

          Flex is based on Flash and puts a layer on top of concepts like stage and

          movieclip to make it less confusing.

           

          When loading another SWF, the first thing you have to decide is how much you

          want to share with it.  A loaded SWF could come from a bad person who will

          then find your password input field and steal passwords.

           

          If you don't trust the other SWF you shouldn't share anything with it, and

          then you won't be able to find out what is going on in it.

           

          If you do trust it, then the SWFLoader.content is the main timeline

          movieclip and you will be able to query it for what frame the SWF is on and

          where its children are.

          • 2. Re: Some general questions about Flash integration to Flex
            happybrowndog Level 1

            Thanks for your answer!

             

            Its good that I can query which frame its on.... but that would ultimately require polling.  Instead is there an event that is triggered for every frame that is entered that I can listen to?  And are these events listenable to a dynamically loaded SWF?