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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:56:35+00:00 2026-05-25T14:56:35+00:00

I am trying to learn Flex and Actionscript. I found the Moock quiz example

  • 0

I am trying to learn Flex and Actionscript. I found the Moock quiz example in Flash and want to turn it into a Flex application. I am trying to understand the relationship between the actionscript and the mxml. How do I take the class QuizApp and place its contents in a container in the mxml file?

MXML

<fx:Script>
<![CDATA[
    import QuizApp;
    var ms:QuizApp = new QuizApp;

    protected function init():void
    {                           
        msc.addChild(ms);
    }

]]>
</fx:Script>

<mx:VBox id="msc" />

Class

package  {

    import flash.display.Sprite;
    import mx.controls.Button;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;

    public class QuizApp extends Sprite {
        //for managing questions:
        private var quizQuestions:Array;
        private var currentQuestion:QuizQuestion;
        private var currentIndex:int = 0;

        public function QuizApp() {
            quizQuestions = new Array();
            createQuestions();
            createButtons();
            createStatusBox();
            addAllQuestions();
            hideAllQuestions();
            firstQuestion();
        }

... etc
    }
}
  • 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-25T14:56:36+00:00Added an answer on May 25, 2026 at 2:56 pm

    I am trying to understand the relationship between the actionscript
    and the mxml.

    MXML is an ActionScript code generation language. When you write MXML, the Flex compiler does some “magic” to turn your MXML file into an ActionScript class. You can save this generated code by specifying the ‘keep-generated-actionscript’ argument to the Flex Compiler. I’ll often shorten it to’-keep’ and it works fine.

    MXML masks a lot of the complexity that is going on under the scenes.

    I hope that helps set your frame of expectations.

    To use your “Flex agnostic” ActionScript Sprite Class inside of a MX Flex Container, you should be able to use it just like any other class you create. First, import the namespace at your top level tag of your component:

    myNamespace:xmlns="*"
    

    Then you should be able to use it, like this:

    <myNamespace:QuizApp id="quizAppInstance" />
    

    If you’re using a Flex 4 Spark Container, you need something that implements IVisualElement; which a Sprite does not. However, you can wrap your own class inside of a SpriteVisualElement class without too much effort.

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

Sidebar

Related Questions

im just starting to learn flex and im trying to understand how Flex does
I'm just starting to learn flex and AS3 I'm trying to get information into
I'm trying to learn Zend AMF but with Flash instead of Flex. I've seen
Trying to learn a bit of CSS and I want a horizontal navbar and
In trying to learn how to create objects in ActionScript, I have had no
I am trying to learn Flex and now i have the next code: http://pastebin.com/rZwxF7w1
I'm currently trying to learn Ruby and I'm trying to understand more about what
I'm trying to learn how to use custom events in Flex. I'm following Oliver
While trying to learn the source for GameLibrary sample application I saw a line
I trying to learn how to program in Adobe Flash Professional CS5. However i

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.