13 Replies Latest reply on Sep 1, 2009 6:14 PM by babo_ya

    Simple Task - Syntax Question (how do you pass variables from one component to another component - databinding)?

    DeyBwah

      Hi all,

       

      I'm trying to pass some width/height/URLs from a Video Player component to a Social Bookmarking component's embed text input field. (for people to grab and share videos).

       

      I know this is a simple task, but it's the end of the day and I seem to be having a brain failure... What's the syntax to achieve this? Do I have to import the video player component? These widths/heights/URLs are all being dynamically generated from an XML... should I be pulling it from the XML or just reuse the variables that already exist in the Video Player component?

       

      Here's my code...

       

      Video Player:

       

       

      [Bindable]

      public var source:String = "";

      [Bindable]

      public var autoPlay:Boolean = false;

      [Bindable]

      public var fullScreenMode:Boolean = false;

      [Bindable]

      public var clipTag:String = "_movie";

      [Bindable]

      public var iag_code:String = "";

      [Bindable]

      public var officialURL:String = "http://www.movies.com/";

      [Bindable]

      public var referer:String = "unknown";

      [Bindable]

      public var gID:String;

      [Bindable]

      public var starterImageURL:String = 'http://www.movies.com/jazzmaster/images/default_starter_image.

      [Bindable]

      public var oldWidth:Number;

      [Bindable]

      public var oldHeight:Number;

       

       

      Sharing Component:

       

      <mx:HBox

        height="10%"

        horizontalCenter="-25"

        verticalCenter="0"

        paddingBottom="5">

        <mx:Text text="Embed Code:" paddingTop="1" color="#FFFFFF" fontSize="12"/>

        <mx:TextInput  text="{oldWidth}"/>

       

      </mx:HBox>

       

      The code above throws an error... "Attempted access of inaccessible property oldWidth through a reference with a static type com:SharingBookmarks."

       

      Thanks all!

      DK