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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:19:18+00:00 2026-06-03T13:19:18+00:00

My problem is this: I want to use mxml for visual element… i want

  • 0

My problem is this:
I want to use mxml for visual element… i want to graphically set components and in an as class to program because it easy to me… How to do this??? I have two classes: one as and one mxml…This is my code:

public class chat extends Application{
    private var nc:NetConnection = null;
    public var connect:Button;      
    public var status:Text;

    public function VideoChat(){
        addEventListener(FlexEvent.APPLICATION_COMPLETE, mainInit);
    }

    private function mainInit(event:FlexEvent):void{            
        status.text = "Status quo";

        connect.addEventListener(MouseEvent.CLICK, doConnect);
    }

and mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
           xmlns:s="library://ns.adobe.com/flex/spark"
           xmlns:mx="library://ns.adobe.com/flex/mx"
           minWidth="955" minHeight="600" backgroundColor="#FBF8F8"
           preloaderChromeColor="#CC3535" 
           >

    <mx:Button x="77" y="547" height="19" label="Connect" id="connect"/>
    <mx:UIComponent id="videoReceiveContainer" x="77" y="52" width="500" height="400"/>
    <mx:Button x="507" y="547" label="Play" id="play"/>
    <mx:Text id="status" x="77" y="460" width="501" height="58"/>
    <mx:Button x="297" y="547" label="Publish" id="publish"/>
</s:Application>
  • 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-03T13:19:19+00:00Added an answer on June 3, 2026 at 1:19 pm

    First of all, your AS3 code is a liiiittle bit funky.

    public class VideoChat extends Application{
        private var nc:NetConnection = null;
        public var connect:Button;      
        public var status:Text;
    
        public function VideoChat(){
            addEventListener(FlexEvent.APPLICATION_COMPLETE, mainInit);
        }
    
        private function mainInit(event:FlexEvent):void{            
            status.text = "Status quo";
    
            connect.addEventListener(MouseEvent.CLICK, doConnect);
        }
    }
    

    The name of the class has to match the name of the constructor.

    Second, the MXML:

    <?xml version="1.0" encoding="utf-8"?>
    <local:VideoChat xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx"
                     xmlns:local="*"
                     minWidth="955" minHeight="600" backgroundColor="#FBF8F8"
                     preloaderChromeColor="#CC3535" 
                     >
    
        <mx:Button x="77" y="547" height="19" label="Connect" id="connect"/>
        <mx:UIComponent id="videoReceiveContainer" x="77" y="52" width="500" height="400"/>
        <mx:Button x="507" y="547" label="Play" id="play"/>
        <mx:Text id="status" x="77" y="460" width="501" height="58"/>
        <mx:Button x="297" y="547" label="Publish" id="publish"/>
    </local:VideoChat>
    

    If you notice, I defined the XML namespace ‘local’ xmlns:local="*". And the s:Application tag has been replaced with local:VideoChat.

    Lastly, you asked in a comment what the path was to load the page. It should be ...bin-debug/name.html. This HTML file is a wrapper that displays the compiled SWF of your project.

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

Sidebar

Related Questions

This problem is easy fixed clientside. But for performance I want to do it
I've got this problem.. it's soon not problem, but i want not to use
I have problem with not members of a class functions. I want to use
I'm experiencing this problem: I want to add the Google Maps API to my
I Have two problem in this Case : I want to pass a JSON
my problem is a bit similar to this : I want to retrieve rows
I stumbled across this problem in F#. Suppose, I want to declare two types
I want to paginate query results in CodeIgniter to look like this: Problem 1
could someone help me on this problem, i want to access facebook API through
I am having problem with this javascript function. If I want to submit a

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.