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

Flash say property is undefined yet it appears to be?

Explorer ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

Hello again. I'm very close to finishing the easier part of my Paper Doll game. But my latest demo stoped working and I can't pin down the reason. The issue may be too many uses of a similar code, but I don't know how to rewrite it... Here, I will post code from the problem page and hylight the lines making flash upset.

import fl.controls.ColorPicker;

import fl.events.ColorPickerEvent;

import flash.geom.ColorTransform;

{

  {

var myGenderArray = [male, female, none];

for each (var Gender in myGenderArray) {

}

var myDepArray = [dep0, dep1, dep2, dep3, dep4, dep5, dep6, dep7, dep8, dep9, dep10, dep11, dep12];

for each (var Dep in myDepArray) {

}

var myEyeArray = [eye1, eye2, eye3, eye4, eye5, eye6, ocd];

for each (var Eye in myEyeArray) {

}

var myAnxArray = [anx0, anx1, anx2, anx3, anx4, anx5, anx6, anx7, anx8, anx9, anx10, anx11, anx12];

for each (var Anx in myAnxArray) {

}

var myPanicArray = [pan0, pan1, pan2, pan3, pan4, pan5, pan6, pan7, pan8, pan9, pan10, pan11, pan12];

for each (var Panic in myPanicArray) {

}

var myADhdArray = [ad0, ad1, ad2, ad3, ad4, ad5, ad6, ad7, ad8, ad9, ad10, ad11, ad12];

for each (var ADhd in ADhdArray) {

}

var myODD1Array = [odd0, odd1, odd2, odd3, odd4, odd5, odd6, odd7, odd8, odd9, odd10, odd11, odd12];

for each (var ODD1 in ODD1Array) {

}

var myExtraArray = [bip, dia, ptsd, remove];

for each (var Extra in ExtraArray) {

}

  Gender.addEventListener(MouseEvent.CLICK, onGenderClick);

  Dep.addEventListener(MouseEvent.CLICK, onDepClick);

  Eye.addEventListener(MouseEvent.CLICK, onEyeClick);

  Anx.addEventListener(MouseEvent.CLICK, onAnxClick);

  Panic.addEventListener(MouseEvent.CLICK, onPanicClick);

  ADhd.addEventListener(MouseEvent.CLICK, onADhdClick);

  ODD1.addEventListener(MouseEvent.CLICK, onODD1Click);

  Extra.addEventListener(MouseEvent.CLICK, onExtraClick);

}

function onGenderClick (event:MouseEvent):void {

  body1.gotoAndStop(event.target.name);

}

function onDepClick (event:MouseEvent):void {

  body2.gotoAndStop(event.target.name);

}

function onEyeClick (event:MouseEvent):void {

  body3.gotoAndStop(event.target.name);

}

function onAnxClick (event:MouseEvent):void {

  body4.gotoAndStop(event.target.name);

}

function onPanicClick (event:MouseEvent):void {

  body5.gotoAndStop(event.target.name);

}

function onADhdClick (event:MouseEvent):void {

  body6.gotoAndStop(event.target.name);

}

function onODD1Click (event:MouseEvent):void {

  body7.gotoAndStop(event.target.name);

}

function onExtraClick (event:MouseEvent):void {

  body8.gotoAndStop(event.target.name);

}

}

The program claims that ADhdArray, ODD1Array, and ExtraArray are undefined properties. But I assembled these Arrays and all pieces the same way as all the others, They have buttons and frame labels set up for the array, and the linked to the movie files with instance names set up accordingly.

I can post more code if needed, and would be thankful for any help.

(Oh in case anyone wants to see the last working model, its here: Traits Demo2 - mars714's Sta.sh  )

TOPICS
ActionScript

Views

608

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

Community Expert , May 28, 2018 May 28, 2018

the first problematic line of code uses ADhdArray and that's not defined in the code you showed.  you do show myADhdArray being defined but if those are supposed to be the same, they need the same reference name.  likewise, for the other problematic lines.

Votes

Translate

Translate
Community Expert ,
May 28, 2018 May 28, 2018

Copy link to clipboard

Copied

the first problematic line of code uses ADhdArray and that's not defined in the code you showed.  you do show myADhdArray being defined but if those are supposed to be the same, they need the same reference name.  likewise, for the other problematic lines.

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
Explorer ,
May 29, 2018 May 29, 2018

Copy link to clipboard

Copied

Thank you! I was going over the code over and over but I didn't notice that 'my' appeared in the second line in those that worked, and not in the error lines. Sometimes I just miss little things like that ^^; any how, Thanks again!

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
Community Expert ,
May 29, 2018 May 29, 2018

Copy link to clipboard

Copied

LATEST

you're welcome.

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