Re: [Flashcoders] trivial or mysterious problem with component?

2006-08-13 Thread Haikal Saadh

Hmm.

V2 components are meant to have empty constructors, with initialisation
being performed in an init() method, which will be called by the
component architecture when the time is right.

Try moving your code in your constructer to init();

Costello, Rob R wrote:
Dear all 

 I have a strange problem getting a V2 component to initialize 
I can copy code works that fine in one class, compiled into another
class (and another swf), and it no longer works - just fails silently  

This is the essence of it : 


import mx.controls.Button;

class Mysterious {
function Mysterious () {
doStuff()
}

function doStuff() {
var endNoteButt = _root.createClassObject(Button,
endNoteButt,1000);
trace(endNoteButt);
;
}
}


In the original class, it traces : _level0.endNoteButt
In the new class it traces : undefined 


Very odd ...i might well be missing something trivial / obvious, but I
can't see it... 


I know that V2 objects need some time to fully initialize, but they
shouldn't return undefined? 

Bit more info that might help someone advise me here 
(1) in the first (working) case, Mysterious is instantiated from another

class - in the second from the main timeline
(2) using MX2004 IDE - both swf's compile and run fine - no errors
(3) this is a new PC. fscommand also seems to have stopped working on
this machine - unrelated? Security issue? 
(4) both have same directory location, and class paths set for the swf


Help?! 

TIA 
Rob 


Important -
This email and any attachments may be confidential. If received in error, please 
contact us and delete all copies. Before opening or using attachments check them 
for viruses and defects. Regardless of any loss, damage or consequence, whether 
caused by the negligence of the sender or not, resulting directly or indirectly 
from the use of any attached files our liability is limited to resupplying any 
affected attachments. Any representations or opinions expressed are those of the 
individual sender, and not necessarily those of the Department of Education  
Training..
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

  




--
Haikal Saadh
Applications Programmer
ICT Resources, TALSS
QUT Kelvin Grove
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] trivial or mysterious problem with component?

2006-08-11 Thread Costello, Rob R
Dear all

 I have a strange problem getting a V2 component to initialize
I can copy code works that fine in one class, compiled into another
class (and another swf), and it no longer works - just fails silently

This is the essence of it :

import mx.controls.Button;

class Mysterious {
function Mysterious () {
doStuff()
}

function doStuff() {
var endNoteButt = _root.createClassObject(Button,
endNoteButt,1000);
trace(endNoteButt);
;
}
}


In the original class, it traces : _level0.endNoteButt
In the new class it traces : undefined

Very odd ...i might well be missing something trivial / obvious, but I
can't see it...

I know that V2 objects need some time to fully initialize, but they
shouldn't return undefined?

Bit more info that might help someone advise me here
(1) in the first (working) case, Mysterious is instantiated from another
class - in the second from the main timeline
(2) using MX2004 IDE - both swf's compile and run fine - no errors
(3) this is a new PC. fscommand also seems to have stopped working on
this machine - unrelated? Security issue?
(4) both have same directory location, and class paths set for the swf

Help?!

TIA
Rob

Important -
This email and any attachments may be confidential. If received in error, 
please contact us and delete all copies. Before opening or using attachments 
check them for viruses and defects. Regardless of any loss, damage or 
consequence, whether caused by the negligence of the sender or not, resulting 
directly or indirectly from the use of any attached files our liability is 
limited to resupplying any affected attachments. Any representations or 
opinions expressed are those of the individual sender, and not necessarily 
those of the Department of Education  Training..
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com