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

Error #1069: Property x not found on String and there is no default value.

Guest
Oct 06, 2012 Oct 06, 2012

Copy link to clipboard

Copied

hi

attached is code in which i try to get the "targets" x (last line) but when i try "trace" it i receive the error message:

ReferenceError: Error #1069: Property x not found on String and there is no default value.

          at suduku_fla::MainTimeline/drop_faces()

what is my mistake?



import flash.display.*;


import flash.events.*;


import flash.text.TextField;

//aba1.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

aba2.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

aba3.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

aba4.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

//baby1.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

baby2.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

baby3.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

baby4.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

//girl1.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

girl2.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

girl3.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

girl4.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

//mom1.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

mom2.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

mom3.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

mom4.addEventListener(MouseEvent.MOUSE_DOWN,move_faces);

//aba1.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

aba2.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

aba3.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

aba4.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

//baby1.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

baby2.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

baby3.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

baby4.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

//girl1.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

girl2.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

girl3.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

girl4.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

//mom1.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

mom2.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

mom3.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

mom4.addEventListener(MouseEvent.MOUSE_UP,drop_faces);

var hit;

var targets;

function move_faces(evt:MouseEvent):void{



var object = evt.target;


object.startDrag();


hit=object.name


trace(hit)


trace(object.x)

}



function drop_faces(evt:MouseEvent):void{




var obj = evt.target;


obj.stopDrag();


targets=(obj.dropTarget.parent.name)


trace(targets);


trace(targets.x)












}








TOPICS
ActionScript

Views

3.5K

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 , Oct 06, 2012 Oct 06, 2012

don't use the name property.  that is a string:


targets=(obj.dropTarget.parent)


trace(targets);


trace(targets.x)

Votes

Translate

Translate
Community Expert ,
Oct 06, 2012 Oct 06, 2012

Copy link to clipboard

Copied

don't use the name property.  that is a string:


targets=(obj.dropTarget.parent)


trace(targets);


trace(targets.x)

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
Oct 06, 2012 Oct 06, 2012

Copy link to clipboard

Copied

thank you.

correct - as usual

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 ,
Oct 06, 2012 Oct 06, 2012

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