A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Importing 3d tga files in to Flash??

  1. #1
    Junior Member
    Join Date
    Feb 2004
    Location
    Wigan, England
    Posts
    7

    Importing 3d tga files in to Flash??

    Hi,

    I have some really nice 3d animation (not sure what it was created in) which has been supplied to me as exported .tga files.

    A particle 3d animation has been supplied to me in 610 single stills so as you can imagine when I import it into flash the SWF file size is large in fact it is around 80mb.

    Does anyone have any suggestions i.e. use a specific flash plugin for .tga files or suggest the 3d animation be exported as a different format??

    I wanted to add each still to a separate frame so that I can control the animation.

    I'm really not sure so any suggestions would be a big help.

    Cheers

  2. #2
    Member
    Join Date
    Dec 2009
    Posts
    84
    I have no experience with 3d files in Flash, but have faced a similar situation. I created a program to "spin" an image of a product. There were actually 180 images (one image for every 2 degrees of rotation), and I DID NOT want to import one image to each frame. I renamed all of the photos in sequential order (image_1, image_2,...) and then had the images load depending on the location of what I called the "mover" in relation to the "slider_bar". It looked similar to this:

    PHP Code:
    var container:Sprite = new Sprite();
    addChild(container);

    addEventListener(Event.ENTER_FRAMEloadImage);

    function 
    loadImage(ev:Event):void{
    while(
    container.numChildren>0){
    container.removeChildAt(0);
    }
    var 
    pos:uint = ((mover.x-slider_bar.x)/slider_bar.width)*180;
    var 
    ldr:URLLoader = new URLLoader();
    var 
    url:URLRequest = new URLRequest("images/image_"+pos+".jpg");
    var 
    ldr.load(url);
    container.addChild(ldr);


  3. #3
    Junior Member
    Join Date
    Feb 2004
    Location
    Wigan, England
    Posts
    7
    Thanks, I've tried this but for some reason it doesn't like it. Do you have a sample FLA you could supply?

  4. #4
    Member
    Join Date
    Dec 2009
    Posts
    84
    I no longer have the one with 180 images, it now belongs to the client I made it for. Here is one I threw together really quickly this morning. Hope it helps you.

    Just add a slider from Window>Components to your library and here is the AS3 code:

    PHP Code:
    import fl.controls.Slider;
    import fl.events.SliderEvent;

    var 
    container:Sprite = new Sprite();
    container.125;
    container.15;
    var 
    slider:Slider = new Slider();
    slider.50;
    slider.350;
    slider.minimum 0;
    slider.maximum 7;
    slider.width 450;
    slider.snapInterval 1;
    slider.tickInterval 1;
    slider.liveDragging true;
    addChild(slider);
    addChild(container);

    var 
    initLdr:Loader = new Loader();
    var 
    initUrl:URLRequest = new URLRequest("images/0.jpg");
    initLdr.load(initUrl);
    container.addChild(initLdr); 
    I also attached a folder of 8 images. Just save it in the same location as your fla.
    Attached Files Attached Files

Tags for this Thread

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