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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:57:10+00:00 2026-06-18T05:57:10+00:00

In a Flex mobile app I have 5 View s, handling OAuth logins through

  • 0

In a Flex mobile app I have 5 Views, handling OAuth logins through 5 different social networks – including Google+ and Facebook. The Views are being selected through the menu shown below:

enter image description here

The filenames are FB.mxml, GG.mxml, MR.mxml, OK.mxml, VK.mxml and their source code looks very similar:

<?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" 
        viewActivate="loadInfo(event)"
        viewDeactivate="closeSWV(event)"
        title="Facebook.com">
....
            private function closeSWV(event:Event=null):void {
                _busy.visible = _busy.includeInLayout = false;
                _reload.visible = _reload.includeInLayout = true;

                stage.removeEventListener(Event.RESIZE, resizeSWV);
                if (! _swv)
                    return;
                _swv.removeEventListener(Event.COMPLETE, extractAccessToken);
                _swv.removeEventListener(LocationChangeEvent.LOCATION_CHANGE, extractAccessToken);
                _swv.removeEventListener(IOErrorEvent.IO_ERROR, closeSWV);
                _swv.removeEventListener(ErrorEvent.ERROR, closeSWV);
                _swv.dispose();
                _swv = null;
            }           

            private function resizeSWV(event:Event=null):void {
                if (! _swv)
                    return;
                // align to the right-bottom corner
                _swv.viewPort = new Rectangle(stage.stageWidth - Preferans.SCALE * width, 
                    stage.stageHeight - Preferans.SCALE * height, 
                    Preferans.SCALE * width, 
                    Preferans.SCALE * height);
            }
....
        <s:VGroup>
            <s:Label id="_first"  fontWeight="bold" text="Your name:" />
            <s:Label id="_gender" fontWeight="bold" text="Gender:" />
            <s:Label id="_city"   fontWeight="bold" text="City:" />
        </s:VGroup>

    <s:Button id="_play"
              label="Play" 
              click="startGame(event)"
              includeInLayout="false"
              visible="false" />
</s:View>

My problem is: The 5 mxml files listed above have many similar methods and variables and UI elements and only few different methods and variables.

I’ve tried to introduce a “base class” for them all several times already and have always given up, because it is not straightforward for mxml files (versus pure AS3 classes).

Does anybody please have an idea, how to approach this?

  • 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-18T05:57:12+00:00Added an answer on June 18, 2026 at 5:57 am

    You can define an abstract class that extends the UI component that you want to use in each row of the list. In your case, it will extend View.

    package your.package{
        public class SocialAccountView extends View{
    
            // in this class you can add the generic methods
            // that you want the view to have
    
        }
    }
    

    After that, in the mxml file you can use the class you created as the main type instead of View

    <your.package:SocialAccountView
        xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        viewActivate="loadInfo(event)"
        viewDeactivate="closeSWV(event)"
        title="Facebook.com">
    
    </your.package:SocialAccountView>
    

    With this you know that all the items in the list are of that type, and have the methods of the parent class. You can even override methods in each view.

    Regarding the UI components, the maximum abstraction level (that I am aware of) you can have with them is to build an extra component and use it in all views. Something like…

    Labels.mxml

        <s:VGroup>
            <s:Label id="_first"  fontWeight="bold" text="Your name:" />
            <s:Label id="_gender" fontWeight="bold" text="Gender:" />
            <s:Label id="_city"   fontWeight="bold" text="City:" />
        </s:VGroup>
    

    and then use it in each component like

    <your.package:Labels 
                  id="labelsComponent"/>
    

    Hope this helps.

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

Sidebar

Related Questions

I have a Flex mobile app that currently contains 2 views View 1 has
I have a view like this in my Flex mobile Application: <s:View xmlns:fx=http://ns.adobe.com/mxml/2009 xmlns:s=library://ns.adobe.com/flex/spark
I have a flex mobile app which based upon a list of questions generates
I am building an mobile flex app in eclipse indigo and have my app
I have to create an mobile flex application with tabbed navigator view. One of
I have a requirement to build a flex mobile app (iOS/Android) which is capable
I'm working in a mobile app for iPad in Flex 4, I have a
I want my flex mobile app to connect to the Google services, specifically the
I have developed a mobile app in Flex 4.6, and generated a .apk file
In my Flex 4.5 mobile app, I have an actionScript item renderer (that derives

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.