A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [as2] external image tiled background [help please!]

  1. #1
    ...dishing dimes on an .fla! pointguard's Avatar
    Join Date
    Dec 2001
    Location
    Cambridgeshire, England
    Posts
    1,017

    [as2] external image tiled background [help please!]

    Hi...

    I've run into a bit of a small -ish prolem.
    I'm using my trusty tiled background code which tiles an image in my library, with the linkage name of 'tile'.
    PHP Code:
        var tile:BitmapData BitmapData.loadBitmap("tile");
        
    _parent.tileMC.beginBitmapFill(tile);
        
    _parent.tileMC.moveTo(00);
        
    _parent.tileMC.lineTo(Stage.width0);
        
    _parent.tileMC.lineTo(Stage.width4000);
        
    _parent.tileMC.lineTo(04000);
        
    _parent.tileMC.lineTo(00);
        
    _parent.tileMC.endFill();
    }; 
    I know there must be a way to have the original image loaded via xml, so it can be chnaged quickly if necessary without opening up flash.
    I've got my xml set up so it loads the tile jpeg into a variable called '_parent.BgdImage', and have tried this as my code to tile that, but I get no joy!
    PHP Code:
        var tile:BitmapData BitmapData.loadBitmap(_parent.BgdImage);
        
    tile.draw(_parent.BgdImage);
        
    _parent.tileMC.beginBitmapFill(tile);
        
    _parent.tileMC.moveTo(00);
        
    _parent.tileMC.lineTo(Stage.width0);
        
    _parent.tileMC.lineTo(Stage.width4000);
        
    _parent.tileMC.lineTo(04000);
        
    _parent.tileMC.lineTo(00);
        
    _parent.tileMC.endFill();
    }; 
    Does anyone have any ideas on where to go from here. Thought this would be a simple thing...

    Cheers for any advice offered
    Jeff

  2. #2
    Member
    Join Date
    Nov 2009
    Location
    Philadelphia
    Posts
    40
    I would trace _parent.BgdImage to see if it is really grabbing the data. I bet your variable is not set correctly.
    - Nick Stanziani

    pls support: www.whowantsacookie.com

    My site: pebcak

  3. #3
    ...dishing dimes on an .fla! pointguard's Avatar
    Join Date
    Dec 2001
    Location
    Cambridgeshire, England
    Posts
    1,017
    Quote Originally Posted by nstanziani View Post
    I would trace _parent.BgdImage to see if it is really grabbing the data. I bet your variable is not set correctly.

    Yes, thanks...it does grab the data fine from the xml. I've already traced it out to make sure...
    I'm not sure if you can take an image file externally and load the bitmapData in this way I'm trying...does anyone know if you can?

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