Note that there are some explanatory texts on larger screens.

plurals
  1. POpass a string statement from a class, AS3
    primarykey
    data
    text
    <p>I want a way to pass a string statement from one base class to an other. The two classes are CLICK and READ. What's an easy way to do this? I haven't worked in classes that often to know some of the simple tricks. I appreaciate your help.<br> Thanks,</p> <p>Class: CLICK<br> Base Class: ClickClass<br> Object I've turned in to a base class and placed in the same FLA</p> <pre><code>package { import flash.events.Event; import flash.display.MovieClip; import flash.text.TextField; import flash.events.MouseEvent; import flash.display.*; public class ClickClass extends MovieClip { //public var read:String = "It's Done!"; public function ClickClass() { b.addEventListener(MouseEvent.CLICK, onClick); } public function onClick(event:MouseEvent){ trace("test!"); //t.text = String(read); //ReadClass.t.text = String(read); } } } </code></pre> <p>Class: READ<br> Base Class: ReadClass<br> Object I've turned in to a base class and placed in the same FLA</p> <pre><code>package { import flash.events.Event; import flash.display.MovieClip; import flash.text.TextField; import flash.events.MouseEvent; import flash.display.*; public class ReadClass extends MovieClip { public var read:String = "It's Done!"; public function ReadClass() { //t.text = String(read); /* 1119: Access of possibly undefined property read through a reference with static type Class. */ } //public functions } } </code></pre> <hr> <p>ERRORS: 'talk to a DynamicTextField in an other class'<br></p> <p>1119: Access of possibly undefined property read through a reference with static type Class.</p> <p>1120: Access of undefined property read.<strong>'previous error'</strong><br></p> <p>ERROR: 'Attaching scripts to document class'<br> 5006: An ActionScript file can not have more than one externally visible definition</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload