Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-27-2009, 08:20 AM   #1
harikrishna
Registered User
 
Join Date: Jan 2009
Posts: 2
Default Error code 1131

I am begginer in flex.
when i was trying to write code in as files.I am unable to import the class file in mxml document .please help me to acess members of a class in mxml file.
my code im mxml document
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="black" >
<mx:Script >
<[CDATA[
import mx.controls.Alert;
import codefiles.login ;
import flash.events.Event;

public function onPress1(event:Event):void

{
Alert.show("onpress");
onPress();
}
]]>
</mx:Script>
<mx:Canvas>
<mx:Label id="userName_lbl" text="User Name :" y="200" fontSize="14" x="350" color="white">
</mx:Label>
<mx:TextInput id="userName_txt" x="450" y="200" borderStyle="solid" focusEnabled="true" >
</mx:TextInput>
<mx:Label id="password_lbl" text="Password :" y="250" fontSize="14" x="350" color="white">
</mx:Label>
<mx:TextInput id="password_txt" x="450" y="250" borderStyle="solid" displayAsPassword="true" >
</mx:TextInput>
<mx:Button id="login_btn" label="Login" x="450" y="300" textRollOverColor="white" textSelectedColor="blue" click="onPress1(event)"/>
</mx:Canvas>
</mx:Application>


code in as file

[SWF(width="500", height="400", frameRate="30", backgroundColor="#ffffff")]
package codefiles
{
import mx.controls.Alert;

class login
{
public function login()
{
Alert.show("login constructor");
var i = 0 ;
i++ ;
}
public function onPress():void
{
trace(" onPress function");
var i = 0 ;
i++ ;
}

}
}
harikrishna is offline   Reply With Quote
Old 01-27-2009, 08:56 AM   #2
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

Class "login" should be called "Login" for the start... but... where did you want to use it? Your MXML and AS files are not related, meaning, where did you want to use that login class / what should it do?
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
1131: Classes Must Not Be Nested Sakiro Atropos ActionScript 3.0 9 03-15-2008 03:31 PM


All times are GMT. The time now is 05:27 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.