[Flashcoders] Live Preview Woes

2005-12-14 Thread Judah Frangipane


I am working on a component that attaches a movieclip. When I drag it to 
the stage it attaches multiple copies of this movieclip skipping my 
checks and balances. But when I test the movie it works fine and only 
shows one instance like i designed it to. Is there anyway to find out in 
my component class file if the instance is on the stage or in a test movie?


class myComponent extends TextInput {

  // constructor
  function myComponent() {

  }

  function init() {
 if (onTheStage) {
// exit out and do not attach movie
 }
 else {
// attach movie
 styleRequired()
  }

  }

   // style the text box when the value is valid
   function styleRequired() {
   trace(style required)
   required_mc = 
_parent.attachMovie(required_mc,this+_required, 
this._parent.getNextHighestDepth());

   if (required) {
   trace(required=+required)
   if (requiredAlign==left) {
   required_mc._x = _x - required_mc._width;
   required_mc._y = _y;
   }
   else {
   required_mc._x = _x + __width;
   required_mc._y = _y;
   }
   }
   else {
   required_mc._visible = false;
   }
   }
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Live Preview Woes

2005-12-14 Thread Derek Vadneau
If your component live preview is generated by Flash, when you specify an 
AS2 class in the Component Definition dialog, then you can check for 
_global.isLivePreview in your class code.  Some of the V2 components use 
this.

That variable is populated by Flash when your live preview is generated 
that way.

If your live preview is a SWF that you've published, then you can just 
provide a variable such as this yourself.


Derek Vadneau


- Original Message - 
From: Judah Frangipane [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, December 14, 2005 2:22 PM
Subject: SPAM-LOW: [Flashcoders] Live Preview Woes



I am working on a component that attaches a movieclip. When I drag it to
the stage it attaches multiple copies of this movieclip skipping my
checks and balances. But when I test the movie it works fine and only
shows one instance like i designed it to. Is there anyway to find out in
my component class file if the instance is on the stage or in a test 
movie?


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Live Preview Woes

2005-12-14 Thread Judah Frangipane

That worked. Thanks :)

// in my class
// traces 'true' in components on the stage and 'undefined' in test movie
trace(_global.isLivePreview =  + _global.isLivePreview)


Derek Vadneau wrote:

If your component live preview is generated by Flash, when you specify an 
AS2 class in the Component Definition dialog, then you can check for 
_global.isLivePreview in your class code.  Some of the V2 components use 
this.


That variable is populated by Flash when your live preview is generated 
that way.


If your live preview is a SWF that you've published, then you can just 
provide a variable such as this yourself.



Derek Vadneau


- Original Message - 
From: Judah Frangipane [EMAIL PROTECTED]

To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, December 14, 2005 2:22 PM
Subject: SPAM-LOW: [Flashcoders] Live Preview Woes



I am working on a component that attaches a movieclip. When I drag it to
the stage it attaches multiple copies of this movieclip skipping my
checks and balances. But when I test the movie it works fine and only
shows one instance like i designed it to. Is there anyway to find out in
my component class file if the instance is on the stage or in a test 
movie?



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders