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 8022095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:10:21+00:00 2026-06-04T22:10:21+00:00

I’m trying to figure out the right approach for Code behind using flash builder

  • 0

I’m trying to figure out the right approach for “Code behind” using flash builder for a mobile app:

  1. I’m creating a flex mobile AIR project (Based on the “Tabbed view” template)
  2. setting my UI in design mode
  3. now I want all the logic to be in a separate class that will change the UI look accordingly

Sounds easy, however I can’t really get the approach for doing it, any help is appreciated 🙂

Update:

main app:

<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                  xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160">
    <s:ViewNavigator label="a" width="100%" height="100%" firstView="views.aView"/>
    <s:ViewNavigator label="b" width="100%" height="100%" firstView="views.bView"/>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
</s:TabbedViewNavigatorApplication>

view A:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" title="a">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label id="txt" x="280" y="139" text="Label"/>
</s:View>

So now I want MyClass to change txt textField according to my logic, what is the right approach?

  • 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-06-04T22:10:22+00:00Added an answer on June 4, 2026 at 10:10 pm

    An elegant way would be implementing IMXMLObject. When implementing this interface, the IMXMLObject#initialize method will take the component (named document of type Object) and an optional id (of type String) as arguments and u can easily implement this pattern. The big advantage is, that you use composition over inheritance and when using interfaces, you can use it as some sort of type save mix-in as view behavior:

        package net.icodeapp.examples.views
        {
          import flash.events.MouseEvent;
    
          import mx.core.IMXMLObject;
          import mx.events.FlexEvent;
    
          public class ViewBaseModel implements IMXMLObject
          {
            //-------------------------------------------------------------------------
            //
            //          Properties
            //
            //-------------------------------------------------------------------------
    
            private var _id:String;
    
            private var _viewBase:ViewBase;
    
            protected function set viewBase(value:ViewBase):void
            {
              _viewBase = value;
    
              if (!_viewBase)
                throw new ArgumentError('View must be instance of ViewBase');
    
              if (!_viewBase.initialized)
                _viewBase.addEventListener(FlexEvent.CREATION_COMPLETE, viewBase_creationCompleteHandler, false, 0, true);
              else
                viewCreationCompleted();
            }
    
            //-------------------------------------------------------------------------
            //
            //          Constructor
            //
            //-------------------------------------------------------------------------
    
            public function ViewBaseModel()
            {
            }
    
            //-------------------------------------------------------------------------
            //
            //          Methods
            //
            //-------------------------------------------------------------------------
    
            public function initialized(document:Object, id:String):void
            {
              viewBase = document as ViewBase;
              _id = id;
            }
    
            private function viewCreationCompleted():void
            {
              _viewBase.addEventListener(MouseEvent.CLICK, viewBase_clickHandler);
            }
    
            //-------------------------------------------------------------------------
            //
            //          Event Handler
            //
            //-------------------------------------------------------------------------
    
            private function viewBase_creationCompleteHandler(event:FlexEvent):void
            {
              viewCreationCompleted();
            }
    
            private function viewBase_clickHandler(event:MouseEvent):void
            {
              // todo: do some action
            }
          }
        }
    

    The model is initialized and references are set by the framework. When taking a peek at the generated ActionScript code you’ll see, that IMXMLObject#initialize it called in the constructor after the model is instantiated.

        <?xml version="1.0"?>
        <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:views="net.icodeapp.examples.views.*">
          <fx:Declarations>
            <views:ViewBaseModel/>
          </fx:Declarations>
        </s:Group>
    

    The model would receive by events by the view and can call methods on it.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

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.