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

  • Home
  • SEARCH
  • 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

I'm trying for hours now to solve this problem.. So.. I want to use
this is a post back problem (I don't want to use the client side
I have a problem. I want to use a LINQ query against this database:
I have this problem with UISearchDisplayController . I want to use it in a
I've got this problem.. it's soon not problem, but i want not to use
I know the title is somewhat confusing, my problem is this: I want to
I have this problem: I want to generate a new source code file from
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
I have this problem since I'm beginning in OOP programming I want to close

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.