Macromedia Flex Macromedia Flex
Loading a FlashPaper SWF Into Flex
  Home

Feb 22, 2005 - Loading a FlashPaper SWF Into Flex
Integrating FlashPaper content at runtime

From Matt Chotin:FlashPaperLoader.as

 

class FlashPaperLoader extends mx.controls.Loader {
    function init() : Void
    {
        addEventListener("complete", this.setFlashPaperSize);
        addEventListener("resize", this.setFlashPaperSize);
        scaleContent = false;
    }

 

    function setFlashPaperSize()
    {
        var fp = content.getIFlashPaper();
        // If FlashPaper isn't finished initializing, then try again later
        if (fp == undefined || fp.setSize(width, height) == false)
        {
            doLater(this, "setFlashPaperSize");
        }
    }

}

 

 

Usecase:

 

<mx:Panel id="panel1" label="flash paper document" width="100%" height="100%">
      <FlashPaperLoader contentPath="..."  width="100%" height="100%" />
  </mx:Panel>

File Details
Created On Feb, 22, 2005 by Tariq Ahmed
Last Modified On Feb, 22, 2005 by Tariq Ahmed
Group: Tips and Articles
Flex Versions: All
Category: Integration
Type: Tip
Difficulty: Advanced
Keywords:
Comments (3)
February 23, 2005 06:35AM - Jose Lora
Hi matt. This solution works well on Microsoft Internet Explorer but doesn't work in FireFox.

March 09, 2005 05:21AM - Craig Newroth
Where does the .as file go? I couldn't get this to work....

January 11, 2007 03:47AM - vinay pillay
content.getIFlashPaper(); This does not work in flex2.0

You must be logged in to post.