Re: [Flashcoders] Creating a button class entirely in 2.0 with no symbol association, possible?

2005-11-24 Thread Janis Radins
No thats no a problem, you can do like this:

public function set _x(value:Number):Void {
mc._x = value;
}

2005/11/24, Boon Chew [EMAIL PROTECTED]:
 Thanks Janis.  The problem with doing it  below is that you cannot change _x, 
 _y directly on the mc like you can  with a regular movieclip.

   var b = new myButton();
   b._x = 200; -- won't work


 Janis Radins [EMAIL PROTECTED] wrote:  I'm doing this all the time I've 
 made tonns of different inputs fro
 diferent projects and finally I am planing to code some fullscale AS2
 only UI collection.

 Thats done like this:
 class myButton {
 private var mc:MovieClip;
 function myButton(host:MovieClip, level:Number){
 mc= host.createEmptyMovieClip(myButton+level, level);
 }
 }
 In this case all drawing is done by variable mc.

 2005/11/23, Ian Thomas :
  Oops, last line should be:
 
  var button:MyButton=MyButton(myTimeline.attachMovie(MyButton.symbolName,
  somRandomButton,
  myTimeline.getNextHighestDepth()));
 
  Assuming myTimeline is whatever you're trying to attach the button to...
 
  Ian
 
  On 11/23/05, Ian Thomas  wrote:
  
   Hi Boon,
 Can't remember where I got this solution - definitely not mine - but
   here's how to create a MovieClip-derived class that doesn't need an
   associated library symbol:
   --
   class net.something.MyButton extends MovieClip
   {
   static var symbolName:String = __Packages.net.something.MyButton ;
   static var symbolOwner:Function = MyButton;
  
   public function MyButton()
   {
   }
  
   static var symbolLinked=Object.registerClass(symbolName, symbolOwner);
  
   }
   --
   To create it, use attachMovie:
  
   import net.something.MyButton;
  
   var button:MyButton=MyButton(myTimeline.attachMovie(MyButton.symbolName,
  
   somRandomButton,getNextHighestDepth()));
  
   HTH,
 Ian
  ___
  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




 -
  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
 ___
 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


Re: [Flashcoders] Creating a button class entirely in 2.0 with no symbol association, possible?

2005-11-24 Thread Ian Thomas
On 11/24/05, Boon Chew [EMAIL PROTECTED] wrote:

 Thanks Janis.  The problem with doing it  below is that you cannot change
 _x, _y directly on the mc like you can  with a regular movieclip.

   var b = new myButton();
   b._x = 200; -- won't work


Boon,
   You're quite correct - however the solution I posted will work. It lets
you use the class in all cases like a normal MovieClip object.

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


Re: [Flashcoders] Creating a button class entirely in 2.0 with no symbol association, possible?

2005-11-23 Thread Janis Radins
I'm doing this all the time I've made tonns of different inputs fro
diferent projects and finally I am planing to code some fullscale AS2
only UI collection.

Thats done like this:
class myButton {
private var mc:MovieClip;
function myButton(host:MovieClip, level:Number){
mc= host.createEmptyMovieClip(myButton+level, level);
}
}
In this case all drawing is done by variable mc.

2005/11/23, Ian Thomas [EMAIL PROTECTED]:
 Oops, last line should be:

 var button:MyButton=MyButton(myTimeline.attachMovie(MyButton.symbolName,
 somRandomButton,
 myTimeline.getNextHighestDepth()));

 Assuming myTimeline is whatever you're trying to attach the button to...

 Ian

 On 11/23/05, Ian Thomas [EMAIL PROTECTED] wrote:
 
  Hi Boon,
Can't remember where I got this solution - definitely not mine - but
  here's how to create a MovieClip-derived class that doesn't need an
  associated library symbol:
  --
  class net.something.MyButton extends MovieClip
  {
  static var symbolName:String = __Packages.net.something.MyButton ;
  static var symbolOwner:Function = MyButton;
 
  public function MyButton()
  {
  }
 
  static var symbolLinked=Object.registerClass(symbolName, symbolOwner);
 
  }
  --
  To create it, use attachMovie:
 
  import net.something.MyButton;
 
  var button:MyButton=MyButton(myTimeline.attachMovie(MyButton.symbolName,
 
  somRandomButton,getNextHighestDepth()));
 
  HTH,
Ian
 ___
 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


Re: [Flashcoders] Creating a button class entirely in 2.0 with no symbol association, possible?

2005-11-23 Thread Boon Chew
Thanks Janis.  The problem with doing it  below is that you cannot change _x, 
_y directly on the mc like you can  with a regular movieclip.
  
  var b = new myButton();
  b._x = 200; -- won't work
  

Janis Radins [EMAIL PROTECTED] wrote:  I'm doing this all the time I've made 
tonns of different inputs fro
diferent projects and finally I am planing to code some fullscale AS2
only UI collection.

Thats done like this:
class myButton {
private var mc:MovieClip;
function myButton(host:MovieClip, level:Number){
mc= host.createEmptyMovieClip(myButton+level, level);
}
}
In this case all drawing is done by variable mc.

2005/11/23, Ian Thomas :
 Oops, last line should be:

 var button:MyButton=MyButton(myTimeline.attachMovie(MyButton.symbolName,
 somRandomButton,
 myTimeline.getNextHighestDepth()));

 Assuming myTimeline is whatever you're trying to attach the button to...

 Ian

 On 11/23/05, Ian Thomas  wrote:
 
  Hi Boon,
Can't remember where I got this solution - definitely not mine - but
  here's how to create a MovieClip-derived class that doesn't need an
  associated library symbol:
  --
  class net.something.MyButton extends MovieClip
  {
  static var symbolName:String = __Packages.net.something.MyButton ;
  static var symbolOwner:Function = MyButton;
 
  public function MyButton()
  {
  }
 
  static var symbolLinked=Object.registerClass(symbolName, symbolOwner);
 
  }
  --
  To create it, use attachMovie:
 
  import net.something.MyButton;
 
  var button:MyButton=MyButton(myTimeline.attachMovie(MyButton.symbolName,
 
  somRandomButton,getNextHighestDepth()));
 
  HTH,
Ian
 ___
 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




-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders