A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Sprite Sheet Script

Threaded View

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    7

    Sprite Sheet Script

    So I found a nifty little video that shows how to use AS2.0 to make a sprite sheet that can then be used to allow flash graphics in XNA. However, after copying the code it doesn't seem to want to work for me.

    Here is the video http://www.youtube.com/watch?v=UfZuBY_DAB4

    Here is the code:

    Code:
    cellWidth = 100;
    cellHeight = 150;
    max = 10;
    
    for(i = 1; i<=4; i++)
    {
    	mc = _root.attachMovie("hero", "hero" + i._root.getNextHighestDepth());
    	
    	mc._width = guy._width;
    	mc._height = guy._height;
    	
    	mc._x = (i-Math.floor((i-1)/max)*max)*cellWidth + 100;
    	mc._y = Math.floor((i-1)/max)*cellHeight + 100;
    	
    	mc.gotoAndStop;
    }
    And I will provide a copy of the file I was working with.

    I was applying the code to the Weapon Fire movie clip in the project file (it's the only one with any type of animation), but it didn't work. I tried applying it to the timeline as well, that didn't work either. If somebody could tell me what I'm doing wrong I'd appreciate it :P
    Attached Files Attached Files

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