Be a Supporter!

library class question

  • 201 Views
  • 1 Reply
New Topic Respond to this Topic
tcc85811
tcc85811
  • Member since: Oct. 12, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
library class question Dec. 20th, 2010 @ 12:20 PM Reply

I created a class called "bgitem" that extends the Sprite class and gives it a few extra variables. I've changed the base class of a handful of library items to Sprite and am trying to cast them as "bgitem"s.
Is there any way to convert them on the fly without creating an identical .as for every single library class?

public var building:bgitem = bgitem(new building1())

didn't work.

23450
23450
  • Member since: May. 28, 2003
  • Offline.
Forum Stats
Member
Level 27
Blank Slate
Response to library class question Dec. 20th, 2010 @ 04:02 PM Reply

Instead of making the base class of building1 extend Sprite, make it extend bgitem. No need to cast. Give that a try.


BBS Signature