Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i think you have to remove these lines:</p> <pre><code>public var Bolder:MovieClip; public var Listing2:MovieClip; </code></pre> <p>and try to get your Listing2 object like this:</p> <pre><code>var newListing:Listing2 = s3.getChildAt(0); </code></pre> <p>but if you want to access your listings in the SearchVectorTest class it's better to keep a public reference of them like this (maybe in an array or a vector):</p> <p>SearchVectortest class:</p> <pre><code>public class SearchVectorTest extends MovieClip { /** the array of listings **/ public var listings:Vector.&lt;Listing2&gt;; public function SearchVectorTest(test:Vector.&lt;searchVO1&gt;) { // put the array length in a variable -&gt; if test = null make len = 0 var len:int = test ? test.length : 0; // create your vector for your listings with the len size listings = new Vector.&lt;Listing2&gt;(len, true); // ... for( var k:int = 0; k &lt; len; k++ ) { var bolder:Listing2 = new Listing2(); bolder.mouseChildren = false; // ignore children mouseEvents bolder.mouseEnabled = true; // enable mouse on the object - normally set to true by default bolder.useHandCursor = true; // add hand cursor on mouse over bolder.buttonMode = true; // this must be set to true to have hand cursor // add your linsting to the vector listings[k] = bolder; //... } // ... } } </code></pre> <p>after that you could get your listing like this:</p> <p>sresultnologin.as</p> <pre><code>public class sresultnologin extends MovieClip { public var s1 :Searchreult = new Searchreult (); //public var Bolder :MovieClip; // never used -&gt; useless //public var Listing2 :MovieClip; // never used -&gt; useless public function sresultnologin() { // init addEventListener(Event.ADDED_TO_STAGE, onadded); function onadded (event:Event):void { s1.x=-10; s1.y=10; addChild(s1); } var s3:SearchVectorTest= new SearchVectorTest(new Vector.&lt;searchVO1&gt;); addChild (s3); s1.SRhome.addEventListener(MouseEvent.CLICK, fl_ClickToGoTol); s1.ARsearch.addEventListener(MouseEvent.CLICK, fl_ClickToGosearch); // verify if there are enties in the array if( s3.listings.length &gt; 0 ) { // get the first listing in the listing array var newListing:Listing2 = s3.listings[0]; newListing.addEventListener(MouseEvent.CLICK, goto); } else { // do something if there are no results } } //... } </code></pre> <p>hope that helps ;)</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