A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [FB3] Spritesheets to Flex Builder in a swc?

  1. #1
    Senior Member hatu's Avatar
    Join Date
    Jan 2007
    Posts
    480

    [FB3] Spritesheets to Flex Builder in a swc?

    So I imported a few .pngs to my Flash library and set the linkage for them and compiled the .swc
    Now when I try to use them from Flex, I get this weird behavior on them.
    var bmd:BitmapData = new assets.dudesheet();

    Gives a compiler error:
    Incorrect number of arguments. Expected 2.

    And when I check what dudesheet() wants inside with code completion it shows:
    arg0:Number, arg1:Number

    Now when I change it to
    var bmd:BitmapData = new assets.dudesheet(1,1); or whatever, it works.

    Any idea what's going on with this?
    http://hatu.biz
    Portfolio & games

  2. #2
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    Why do you need to use a .swc? Why can't you just import the spritesheet at runtime, or in the FlexBuilder Library?
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  3. #3
    FK founder & general loiterer Flashkit's Avatar
    Join Date
    Feb 2000
    Location
    Sydney
    Posts
    1,149
    bitmapData objects reqire the two variables as they are "width" and "height",
    it is pretty stupid though I agree as once the bitmapData object is created the width and height are correctlu set to the width and height of the bitmapData. I generally just go new assets.bitmapDataObject(0,0)
    Regards Mark Fennell - Flash Kit Founder, general loiterer
    -------------------------------
    I Hate Zombies - iPhone Game | markfennell.com

  4. #4
    Senior Member hatu's Avatar
    Join Date
    Jan 2007
    Posts
    480
    Ah of course. Sounds like a minor bug that it said arg0 and arg1 instead I guess.

    Pazil, it's the best workflow I've seen yet. I'm not sure what you mean by FlexBuilder Library though. Can you explain it? I'm already using the SWC as a library.
    It's nice to be able to add all assets in Flash and export it with code completion.
    http://hatu.biz
    Portfolio & games

  5. #5
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    Oh,

    What I meant by FlexBuilder Library was (in fact, I'm not sure about this, but it probably has it...FlashDevelop has it) that in FlashDevelop at least, there's a folder called lib where you can drag in images and graphics and such, and it acts much like the Library panel you have in the Flash IDE!

    But whatever works for you! I personally don't have Flash CS3+, so I stick to bitmaps and FlashDevelop.

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center