Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6082955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:20:48+00:00 2026-05-23T11:20:48+00:00

I’ve just started working on a photo viewer type desktop AIR app with Flex.

  • 0

I’ve just started working on a photo viewer type desktop AIR app with Flex. From the main window I can launch sub-windows, but in these sub-windows I can’t seem to access the data I collected in the main window.

How can I access this data?
Or, how can I send this data to the sub-window on creation? It doesn’t need to be dynamically linked.

myMain.mxml

    <?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       width="260" height="200"
                       title="myMain">
    <fx:Declarations>
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            public function openWin():void {
                new myWindow().open();
            }

            public var myData:Array = new Array('The Eiffel Tower','Paris','John Doe');
        ]]>
    </fx:Script>
    <s:Button x="10" y="10" width="240" label="open a sub-window" click="openWin();"/>
</s:WindowedApplication>

myWindow.mxml

    <?xml version="1.0" encoding="utf-8"?>
<mx:Window name="myWindow"
           title="myWindow"
           xmlns:mx="http://www.adobe.com/2006/mxml"
           layout="absolute"
           width="640" height="360">
    <mx:Script>
        <![CDATA[

        ]]>
    </mx:Script>
    <mx:Label id="comment" x="10" y="10" text=""/>
    <mx:Label id="location" x="10" y="30" text=""/>
    <mx:Label id="author" x="10" y="50" text=""/>
</mx:Window>

I realize this might be a very easy question but I have searched the web, read and watched tutorials on random AIR subjects for a few days and couldn’t find it. The risk of looking like a fool is worth it now, I want to get on with my first app!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:20:48+00:00Added an answer on May 23, 2026 at 11:20 am

    You could add an attribute to your window class, and pass the data from the application.

    With an attribute and a setter function :

    myWindow.mxml :

        <![CDATA[
            private var _data : Array;
    
            public function set data(data : Array) : void {
                 this._data = data;
            }
    
        ]]>
    

    main

        <![CDATA[
            public function openWin():void {
                var w : myWindow = new myWindow();
                w.data = myData;
                w.open();
            }
    
            public var myData:Array = new Array('The Eiffel Tower',
                                                'Paris','John Doe');
        ]]>
    

    You could also do it by adding a constructor parameter to your window, but you will have to write your Window component in ActionScript.

    (Also : you might want to use MyWindow for the name of your component instead of myWindow, but that’s just conventionnal nitpicking).

    Also, note that there is a singleton variable Application.application that is accessible to all classes in an Application ; however I don’t know if this applies to a WindowedApplication, and either way it is not the recommended approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I am using Paperclip to handle profile photo uploads in my app. They upload
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.