• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Has anyone received an error in Flash Builder like this?

Guest
Mar 26, 2012 Mar 26, 2012

Copy link to clipboard

Copied

access of undefined property variable01.

access of undefined property pattern.

I don't see a problem with the code, yet the error persists.

<?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>

Views

538

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Mar 26, 2012 Mar 26, 2012

When using Flex you can't just put code in a script tag like this. While declarations (public var etc) can be in this scope, logic must be inside an event handler.

See my answer in this thread:

http://forums.adobe.com/thread/980259

Votes

Translate

Translate
Contributor ,
Mar 26, 2012 Mar 26, 2012

Copy link to clipboard

Copied

When using Flex you can't just put code in a script tag like this. While declarations (public var etc) can be in this scope, logic must be inside an event handler.

See my answer in this thread:

http://forums.adobe.com/thread/980259

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 26, 2012 Mar 26, 2012

Copy link to clipboard

Copied

LATEST

Thanks for your help. I will study the creationComplete event and try it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines