Solved

access of undefined property. What undefined property?

Posted on 2012-03-26
1
331 Views
Last Modified: 2012-03-26
access of undefined property variable01.
access of undefined property pattern.
I don't see a problem with the code, yet the error persists. I am using Flex Builder.

<?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"
               creationComplete="init(event);"
               minWidth="955" minHeight="600" backgroundColor="#cbd8e6">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
        var variable01:String;
        variable01 = "1";

        var pattern:RegExp;
        pattern = /^[0-9]{1,3}$/;

        pattern.test(variable01);
        ]]>
    </fx:Script>
</s:Application>
0
Comment
Question by:kadin
1 Comment
 

Accepted Solution

by:
kadin earned 0 total points
ID: 37768591
I have learned from other sources the open variables variable01 and pattern must reside within an event handler like creationComplete="init(event);" .

public function init():void{                
                var variable01:String;
                variable01 = "1";
                var pattern:RegExp;
                pattern = /^[0-9]{1,3}$/;
                trace(pattern.test(variable01));
            }
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now