Skip navigation
Currently Being Moderated

SWFLoader!!!!!!!!!

Aug 13, 2010 8:41 PM

Hi,

 

I want to place a swfloader with width = 500, height = 400 inside the flex project to load multiple swf and images. Here I want to ask:

 

1. How to prevent the swfloader from displaying content of flash outside the fixed dimension?

2. How is it possible to know when the playback of swf reach the end and perform some action?

 

Thanks.

 
Replies
  • Currently Being Moderated
    Aug 13, 2010 10:55 PM   in reply to Yue_Hong

    1. Apply a mask or scrollrect, or put it in a container that does clipping.

    2. There is no way to know in the general case.  If the SWF is animating

    birds flying or balls bouncing, there's now way to know when it has stopped.

    If the SWFs have a particular behavior it might be possible to know.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 13, 2010 11:37 PM   in reply to Yue_Hong

    Hi,

     

     

    Try to use maintainAspectRatio and scaleContent properties of SWFLoader it will adjust the content..!

     

    if you take the SWF as a movie clip..! we can calculate the totaltime..!

     

    Hope this will help you..!

     

     

    Thanks,

    Pradeep

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 14, 2010 3:20 PM   in reply to Yue_Hong

    If, for example, you know that all SWFs are just timeline animations with no

    script, you can watch for currentFrame == frameCount.

     

    If you know every SWF has a video component referenced as "videoComponent",

    you can get the video component and watch for the video to end.

     

    It all depends on what assumptions you can make.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 14, 2010 11:47 PM   in reply to Yue_Hong

    MovieClip(swfLoader.content).currentFrame

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 15, 2010 11:03 PM   in reply to Yue_Hong

    Loader.content will be null until the SWF is loaded.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2010 12:18 PM   in reply to Yue_Hong

    I think you have to use enterFrame because the complete handler will only

    fire once.  Just test if loader.content == null and exit.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2010 10:15 PM   in reply to Yue_Hong

    If you are loading SWFs not published for AS3 you will need a more

    sophisticated solution.  Google for as3interface.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 30, 2013 2:48 AM   in reply to Flex harUI

    Hi,

     

    I have a same problem so how can i resolve it.

    I have a one problem regarding this. I have multiple swf file and it loads one by one like if first one is finished then next will be loaded.

    I use enterFrame event for checking the frame.

    My problem is that it all working fine in windows pc but when i install this in mac, the swf file play in slow motion and it consume the memory and the mac pc become hangs.

     

    How can i solve this.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 31, 2013 9:18 PM   in reply to Bikrant Singh

    Use performance profiler to see what is taking all the time.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points