first off, the event model has changed so you subscribe to an enterframe event
root.addEventListener("enterFrame",frameListener);

private function frameListener(evt:Event):Void
                    {
                        if(mouseX < 0 || mouseX > this.width || mouseY < 0 || mouseY > this.height)
                        {
                            root.removeEventListener("enterFrame",frameListener);
                            __subMenuExpanded = false;
                            doResize(getStyle('height'));   
                        }
                    }

being an example
then the error is due to the counter var being out of scope.



On 12/16/05, fritzdimmel <[EMAIL PROTECTED]> wrote:
Hi!
I want to start a net flex2 project.
What I want to do is is to have some mxml files and some as classes.
The main app should be a mxml.

I've: (mymxml.mxml)

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*">
        <mx:Label id="myLabel" text="no Text" />
        <mx:Button click="myLabel.text = myAs.myCounter" />
</mx:Application>

and: (myAs.as)
package {
    // import Object.Number;
    import flash.display.MovieClip;
    import flash.util.*;
   
    public class myAs extends MovieClip {
        public var mc:MovieClip;
        public var myCounter: Number = 0;
      
        public function myAs() {
            mc. {
                myCounter =
myCounter + 1;
            }
        }
       
    }
}


When I hit "run" in Eclipse, the app comes. But when I click the button I'll get the message:
ReferenceError: Error #1069: Property myCounter not found on class myAs and there is no default value
    at mymxml/___Button1_click()

What I finally want to do is to bring some AS code from Flash to Flex. But I know, this will get a long way

Thanks for you help,
bye
Fritz



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
j:pn


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to