Solved

access of undefined property. What undefined property?

Posted on 2012-03-26
1
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

696 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