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

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

Try this..
create a new flex project and add a folder called "src"
create a new MXML component named "VideoComp.mxml" and copy/paste
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
<mx:Script>
<![CDATA[
[Bindable]
public var videoWidth:int = 300;
[Bindable]
public var videoHeight:int = 300;
]]>
</mx:Script>
<mx:Label text="Vidoe" />
<mx:TextInput text="{videoWidth}" id="w" change="this.videoWidth = int(w.text);" />
<mx:TextInput text="{videoHeight}" id="h" change="this.videoHeight = int(h.text);" />
</mx:VBox>
create a new MXML component named, "SharingComp.mxml" add copy/paste this..
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
<mx:Script>
<![CDATA[
[Bindable]
public var videoWidth:int;
[Bindable]
public var videoHeight:int;
]]>
</mx:Script>
<mx:Label text="Sharing Comp." />
<mx:Label text="{videoWidth}" />
<mx:Label text="{videoHeight}" />
</mx:VBox>
and here is the main.mxml file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:src="src.*">
    <mx:Script>
        <![CDATA[
            private function doSomething():void
             sharingComp.videoHeight = videoComp.videoHeight;
             sharingComp.videoWidth = videoComp.videoWidth;
        ]]>
    </mx:Script>
   <src:VideoComp id="videoComp" />
   <mx:Button click="doSomething()" label="copy" />
   <src:SharingComp id="sharingComp" />
</mx:Application>
Hope this helps,
BaBo,

Similar Messages

  • How can I pass variables from one project to another using Javascript?

    Hi all, I am trying to do this: let learners take one course and finish a quiz. Then based on their quiz scores, they will be sent to other differenct courses.
    However, I wish keep track on their previous quiz scores as well as many other variables.
    I found this nice widge of upload/download variables by CPguru (http://www.cpguru.com/2011/05/18/save-and-load-data-widget-for-adobe-captivate-4-and-adobe -captivate-5/). However, this widget works by storing variables from one project in local computer and then upload it to another project.
    My targeted learners may not always use the same computer though, so using this widget seems not work.
    All these courses resided in a local-made LMS which I don't have access to their code. Therefore, passing variables to PHP html files seems not work.
    Based on my limited programing knowledge, I assume that using Javascript to pass variables may be the only possible way.
    Can someone instruct me how to do this?
    Thank you very much.

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • HT201250 how can i pass information from one mac to another mac by using the time capsule

    how can i pass information from one mac to another mac by using the time capsule

    If you want to transfer files, settings, etc., you must open Migration Assistant (Applications > Utilities) in the Mac that you want to transfer the files and follow the instructions

  • How do you move icons from one page to another?

    How do you move icons from one page to another?

    hold down on an app till everything start shaking then move it to one side of the ipad and it'll change "pages" after a second or two.

  • How do you transfer money from one account to another

    How do you transfer money from one account to another?

    Credit card.
    You cannot use your credit to buy credit/gifts form someone.

  • How can you transfer data from one ipod to another ?

    How can you transfer data from one ipod to another ipod ?

    The geniusbar told me what to do, I understood but there is still a problem for me >:/ It's not showing up though. Like "device."  Nothing is happening, and I tried as soon as I got home. Then after half an hour, then an hour, then 3 hours. My problem is that it's not showing up! It's stuck in recovery mode! There's still like 25% battery. So I have no idea why.

  • How do you transfer music from one ipad to another?

    How do you transfer music from one ipad to another?

    You can use 3rd party apps like iTransfer using Bluetooth
    https://itunes.apple.com/sg/app/itransfer-share-files-ease/id480195086?mt=8

  • How do you copy files from one user to another

    How do you copy files from one user to another user on the same machine?

    open your home folder in finder move file to public, log into other account, click the go tab on the finder menu, select computer, your hard drive (Macintosh HD Default)>Users, the origonal user> public and drag that file to your specified folder.
    hope it works
    Craig.

  • How do you copy automation from one track to another?

    How do you copy automation from one track to another? Occassionally I mistakenly blow away a track's automation. I open up an earlier version of the song to try to get the automation. It doesn't seem that you can copy and paste the data. After some struggle, I find a way. Is there an easy way?

    1. Copy the track containing the desired automation to another track. (create a track below it to keep things organized)
    2. Double click on the region and delete the notes.
    3. Now copy the region to the desired track.
    P.S. Of course when Logic asks if you want to copy the automation data you say yes)

  • How do you move pictures from one album to another

    how do you move pictures from one album to another?

    Pictures can appear in any number of albums.
    To move from one album to another, add the picture to the new album and then right click on the picture, select Remove from album and then select the album you want to remove it from.
    If you need further help, please let us know which version of Photoshop Elements you are using and which operating system you are running on.
    Brian

  • How do you move pictures from one catalog to another?

    How do you move pictures from one catalog to another?  I have just got the program and have moved pictures into the default catalog. I have now created several new catalogs and want to move pics from the default into the new catalogs. I don't see this answer in the general help or my "dummies" book.

    pspack1 wrote:
    How do you move pictures from one catalog to another?  I have just got the program and have moved pictures into the default catalog. I have now created several new catalogs and want to move pics from the default into the new catalogs. I don't see this answer in the general help or my "dummies" book.
    It's not a good idea to create multiple catalogs. For one thing, this defeats the purpose of the Organizer as a way to search for and find your photos; the search can only operate within a single catalog. Also, there are no functions in PSE that work across multiple catalogs. And even though you can "manually" combine the catalogs if you so desire, you lose information such as collection/album membership, stacks, version sets, creations and a few other things.

  • How do you transfer music from one iphone to another iphone?

    How do you transfer music from one iphone to another iphone?

    In the same way music was transferred to the first iPhone - with iTunes.

  • Passing variables from one swf to another

    I am facing problem to pass variable from one swf to another.
    I am using loadMovie to load another swf. how can I pass a variable
    value to another swf. Can anyone help me plz? It is somewhat
    urgent.
    thanx in advance.

    first of all:
    this is the Flash Media Server and your problem is not
    related to FMS....
    second thing related to the "somewhat urgent" :
    we, users on this forum, are not there to do your job... so
    calm down otherwise no people will answer your question. This forum
    is a free support forum that community of Flash developer use to
    learn tricks and to solve problems.
    Possibles solutions:
    If the two swf are seperate you can use LocalConnection to
    establish a connection between different swf.
    If you load a second swf into the first one you can interact
    like a standard movieClip(only if there from the same domain or if
    you a policy file on the other server)
    You can use SetVariable(via Javascript) to modify a root
    variable on the other swf and check with an _root.onEnterFrame to
    see if the variable had changed in the second swf.
    * MovieClipLoader will do a better job, in your specify case,
    than the loadMovie. Use the onLoadInit event to see when the swf is
    really totaly loaded into the first one otherwise you will have
    timing issues.
    My final answer(lol) is the solution 2 with the
    notice(*)

  • HT1329 how do you transfer music from one ipod to another ipod

    How do I move music from one ipod to another ipod?

    The music that is on the one iPod must be stored in an iTunes library first before it can be synced/added to the other one.  You cannot transfer content directly from one iDevice to another.
    B-rock

Maybe you are looking for

  • Archivelink : CL_GOS_AL_ITEM

    Hello, we are using archive link technology to display documents through the Attachment List within Service for Objects icon in PA20 transaction. We would like to add a custom field in this view and so we need modify SGOS_ATTA structure used by GOS_S

  • Oracle SOA Suite 10.1.3.4 (OC4J) HA cluster installation on RH Linux 64 bit

    We plan to install Oracle SOA Suite 10.1.3.4 (OC4J) HA cluster on Red Hat Linux 64 bit operating system. Are there any special instructions for 64 bit install compared to regular 32 bit install? Any inputs will be really helpful. -Thanks VJ

  • Could not complete the last command : problem with toast 10

    Hi, I am trying to burn blu ray content with Toast 10 Pro (blu-ray content burned to DVD). I have created the content (Quick Time movie) with FCP 7 (into an MOV file). And then added it to Toast 10. Then I tried to create disk image. It gave me this

  • Cisco ACS for Unix authentication

    My company is looking for a single sign on for all the windows and unix servers mainly for admins. I was wondering if Cisco ACS will work for this. Basically the authentication will be all for the servers and routers ofcourse. I am thinking if I spec

  • Scoring in non quiz modules

    Hi, I have a course (captivate6) which does not have quiz in it but i need to record score in numbers... Is there any way we can do it? I tried the reporting option on the click of next button but the pauses that we have on each screen is no more the