Solved

access of undefined property. What undefined property?

Posted on 2012-03-26
1
337 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

730 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