How search text in current frame of external swf?

Hello Everyone
I am loading an external swf using loader.
How do search and highlight the text in the current frame only?
Is there a frame class which I could use?
Thanks

This is not likely to be possible in the general case, depending on what you mean by "searching text"
For instance, a Word doc might have the text "Hello, world!" when viewed in Word, but that doesn't mean that the sequence of characters 'H', 'e', 'l', 'l', 'o', etc., exists in the file. There might be one letter, then some binary data indicating that the next letter is some other font or color, then one more letter, then more binary data, etc.
Conversely, there could be textual metadata in a "binary" file that a person reading the file in the appropriate viewer would never see. Unless you know the details of the format you're reading, you won't be able to distinguish that from "real text".
And what do you mean "strings" is not efficient? Have you tried it? Does it do what you want? Did you measure and determine that it does not meet your well-defined performance requirements? It's unlikely you'll be able to write code that does the same thing as "strings" but more "efficiently."
The first step is to put more realistic boundaries on your requirements and define them more precisely. "Extract text from any binary file," is not a valid, meaningful, or reasonable requirement.
EDIT: I may have misunderstood your requirements. I thought you wanted to "extract all text" from binary files. If that's not what you meant, and you're looking more to replicate grep, then follow Joachim's advice.
Edited by: jverd on Mar 29, 2010 1:33 PM

Similar Messages

  • GotoAndPlay specific frame in external swf from main swf

    I have a main swf that loads 2 external swfs.
    I click on button to see content of external swf #1 and see stuff. I do something that causes external swf to show other stuff (i.e. not at beginning state)
    In the main swf I click on button to see content of external swf #2. External swf #1 content is made invisible and I see content of external swf stuff.
    NOW, if I click on button to take me back to see external swf #1, I see it's content in current state. I want to force it to start over again at frame #1 which will reset content.
    However, no matter what I try, I can't seem to control which frame to go to in external swf using gotoAndplay.
    Here is code in frame #1 of main swf to load external swfs:
    //load academic movie
    var swfLoader1:Loader = new Loader();
    container1.addChild(swfLoader1);
    var url1:URLRequest = new URLRequest("academic.swf");
    swfLoader1.load(url1);
    //load wisdom movie
    var swfLoader3:Loader = new Loader();
    container3.addChild(swfLoader3);
    var url3:URLRequest = new URLRequest("wisdom.swf");
    swfLoader3.load(url3);
    Here is code in frame 2 of main swf that checks button to see where to go in external swf:
    //academic button clicked
    function academicClick(event:MouseEvent){
       container3.alpha = 0;
       container3.visible = false;
       container1.visible = true;
       container1.gotoAndPlay(1); //this is where I am trying to force it to start at frame 1
       container1.alpha = 1;
    I don't want to reload the external movie to force it to start over.
    Any help would be much appreciated.

    You can easily control this by making the external swf to load with your movieclip, The below is the code snippet that clear on accessing the specific frame on external swf.
    //Loading clips content
    var ldr:Loader;
    var mcExt:MovieClip;
    //Loading
    loadswf("external.swf");
    function loadswf(tmp:String):void{
        unloadSwf();
        ldr= new Loader();
        ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
        ldr.load(new URLRequest(tmp));
        function progressListener (e:ProgressEvent):void{
            ploader.visible=true;
        function swfLoaded(e:Event):void {
            mcExt = e.target.content as MovieClip;
            ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
            mcExt.addEventListener(Event.ENTER_FRAME,onEnterfn);
            ploader.visible=false;
            addChild(mcExt);
    //UnLoading
    function unloadSwf():void{
        if (ldr!=null){
            ldr.unloadAndStop();
            removeChild(mcExt);
            mcExt=null;
    //Intervals (The part you work on the specific frame within the external swf
    function onEnterfn(e:Event):void{
        var num:int=mcExt.currentFrame;
        if (num==1) mcExt.play();
        if (num==9) {
                mcExt.skipmc.addEventListener(MouseEvent.CLICK,skipfn);
                function skipfn(e:MouseEvent):void{
                    mcExt.stop();
                    mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
                    gotoAndStop("help");
        if (num==mcExt.totalFrames){
            mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
            gotoAndStop("help");
    hope it solve

  • Uix frameset - how to get the current frame name?

    I have a frameset with 3 different frames in it. a top, center and bottom.
    There is a menu in the top frame that changes the contents of the center or bottom frame.
    How can I get the value of the frame name for the current frame into a bound value like a httpsession or page?
    for example if I change the center frame to "listadmin.uix" how can I load a bound value with the frames new source?
    Is there a way to pass javascript to a boundvalue? I could get the frames new properties from javascript

    In Jdev 9.0.3 you could do something like this:<frameBorderLayout>
    <start>
       <frame name="sideFrame">
        <boundAttribute name="source">
         <ctrl:pageURL name="sideFramePage">
          <ctrl:properties>
           <ctrl:property key="currentFrame"
                          value="sideFrame"/>
          </
         </
        </
       </
    </
    </then in startFramePage.uix you can access the current frame name by doing:<styledText data:text="currentFrame@ctrl:page"/>

  • How can I stop timeline sounds in external swf files from playing during loading?

    I am having a problem with timeline sounds in external swf files playing during loading in a main swf. Can anyone help me?
    Here is some of the code from the main swf. I hope I have included enough.
    Thanks.
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.events.SliderEvent;
    import flash.media.SoundTransform;
    preloader_mc.fill_mc.scaleX = 0;
    var swfA:Array = ["part1.swf","part2.swf"];
    var frameA:Array = [];
    var currentLoader:Loader;
    var swfTotalFrames:int;
    var tl:MovieClip = this;
    var st:SoundTransform = new SoundTransform()
    var index:int = 0;
    loadNextF();
    play_slider.enabled = false;
    function loadNextF():void{
                    tl["loader_"+index] = new Loader();
                    tl["loader_"+index].name = index.toString();
                    tl["loader_"+index].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);
                    tl["loader_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
                    tl["loader_"+index].load(new URLRequest(swfA[index]));
    function progressF(e:ProgressEvent):void{
                    var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);
                    preloader_mc.fill_mc.scaleX = fractionLoaded;
                    preloader_mc.tf.text = (100*fractionLoaded)+"% Loaded";
    function completeF(e:Event):void{
                    tl["loader_"+index].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progress F);
                    tl["loader_"+index].contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);
                    SoundMixer.stopAll();
                    var mc:MovieClip = MovieClip(tl["loader_"+index].content);
                    mc.gotoAndStop(1);
                    frameA.push(mc.totalFrames);
                    index++;
                    if(index<swfA.length){
                                    loadNextF();
                    } else {
                                    // all loads complete.  start play.
                                    restart_mc.buttonMode = true;
                                    restart_mc.alpha = 1;
                                    tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
                                    tl.removeChild(preloader_mc);
                                    preloader_mc = null;
                                    play_slider.enabled = true;
                                    playpause_mc.alpha = 1;
                                    currentLoader = tl["loader_0"];
                                    tl.addChild(currentLoader);
                                    MovieClip(currentLoader.content).play();
                                    sliderParamsF();

    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.events.SliderEvent;
    import flash.media.SoundTransform;
    preloader_mc.fill_mc.scaleX = 0;
    var swfA:Array = ["part1.swf","part2.swf"];
    var frameA:Array = [];
    var currentLoader:Loader;
    var swfTotalFrames:int;
    var tl:MovieClip = this;
    var st:SoundTransform = new SoundTransform()
    var index:int = 0;
    loadNextF();
    play_slider.enabled = false;
    function loadNextF():void{
        tl["loader_"+index] = new Loader();
        tl["loader_"+index].name = index.toString();
        tl["loader_"+index].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);
        tl["loader_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
        tl["loader_"+index].load(new URLRequest(swfA[index]));
    function progressF(e:ProgressEvent):void{
        var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);
        preloader_mc.fill_mc.scaleX = fractionLoaded;
        preloader_mc.tf.text = (100*fractionLoaded)+"% Loaded";
    function completeF(e:Event):void{
        tl["loader_"+index].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progress F);
        tl["loader_"+index].contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);
        SoundMixer.stopAll();
        var mc:MovieClip = MovieClip(tl["loader_"+index].content);
        mc.gotoAndStop(1);
        frameA.push(mc.totalFrames);
        index++;
        if(index<swfA.length){
            loadNextF();
        } else {
            // all loads complete.  start play.
            restart_mc.buttonMode = true;
            restart_mc.alpha = 1;
            tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
            tl.removeChild(preloader_mc);
            preloader_mc = null;
            play_slider.enabled = true;
            playpause_mc.alpha = 1;
            currentLoader = tl["loader_0"];
            tl.addChild(currentLoader);
            MovieClip(currentLoader.content).play();
            sliderParamsF();
    ///////////////// start sliders /////////////////////////////////
    sound_slider.addEventListener(SliderEvent.CHANGE,soundSliderF);
    function soundSliderF(e:SliderEvent):void{
        st.volume = e.value/100;
        tl.soundTransform = st;
    play_slider.addEventListener(SliderEvent.CHANGE,playSliderF);
    play_slider.addEventListener(MouseEvent.MOUSE_DOWN,playSliderDownF);
    //play_slider.addEventListener(MouseEvent.MOUSE_UP,playSliderUpF);
    function playSliderDownF(e:MouseEvent):void{
        tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
        stage.addEventListener(MouseEvent.MOUSE_UP,playSliderUpF);
    function playSliderUpF(e:MouseEvent):void{
        tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
    function playSliderF(e:SliderEvent):void{
        SoundMixer.stopAll();
        var frameNum:int = Math.ceil(swfTotalFrames*e.value/100);
        var partialTotalFrames:int = 0;
        for(var i:int=0;i<frameA.length;i++){
            partialTotalFrames += frameA[i];
            if(partialTotalFrames>=frameNum){
                break;
        partialTotalFrames -= frameA[i];
        //trace(i,frameNum,frameNum-partialTotalFrames);
        if(currentLoader!=tl["loader_"+(i)]){
            tl.removeChild(currentLoader);
            MovieClip(currentLoader.content).stop();
            currentLoader = tl["loader_"+(i)];
            tl.addChild(currentLoader);
        if(playpause_mc.currentFrame==1){
            MovieClip(currentLoader.content).gotoAndPlay(frameNum-partialTotalFrames);
        } else {
            MovieClip(currentLoader.content).gotoAndStop(frameNum-partialTotalFrames);
    function sliderUpdateF(e:Event):void{
        var playedFrames:int = 0;
        for(var i:int=0;i<Number(currentLoader.name);i++){
            playedFrames += frameA[i];
        playedFrames += MovieClip(currentLoader.content).currentFrame;
        play_slider.value = Math.round(100*playedFrames/swfTotalFrames);
    function sliderParamsF():void{
        swfTotalFrames = 0;
        for(var i:int=0;i<swfA.length;i++){
            swfTotalFrames += MovieClip(tl["loader_"+i].content).totalFrames;
    ///////////////// end  sliders //////////////////////////////////
    ///////////////// start playpause restart ///////////////////////
    playpause_mc.addEventListener(MouseEvent.CLICK,playpauseF);
    playpause_mc.alpha = .2;
    restart_mc.addEventListener(MouseEvent.CLICK,restartF);
    restart_mc.buttonMode = false;
    restart_mc.alpha = .2;
    function playpauseF(e:MouseEvent):void{
        if(!e.currentTarget.toggle){
            MovieClip(currentLoader.content).stop();
            tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
            e.currentTarget.gotoAndStop(2);
        } else {
            MovieClip(currentLoader.content).play();
            tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
            e.currentTarget.gotoAndStop(1);
        e.currentTarget.toggle = !e.currentTarget.toggle;
    ///////////////// end playpause //////////////////////////////
    function playUpdateF(e:Event):void{
        sliderUpdateF(e);
        var playingFrame:int = MovieClip(currentLoader.content).currentFrame;
        if(playingFrame==frameA[Number(currentLoader.name)]){
            // next loader
            MovieClip(currentLoader.content).stop();
            SoundMixer.stopAll();
            MovieClip(currentLoader.content).mute();
            var nextIndex:int = Number(currentLoader.name)+1;
            if(nextIndex<swfA.length){
                tl.removeChild(currentLoader);
                currentLoader = tl["loader_"+nextIndex];
                tl.addChild(currentLoader);
                MovieClip(currentLoader.content).gotoAndPlay(1);
            } else {
                tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
                playpause_mc.gotoAndStop(2);
                playpause_mc.toggle = !playpause_mc.toggle;
                //playpause_mc.alpha = .2;
                // all swfs have completed play
    function restartF(e:MouseEvent):void{
        MovieClip(currentLoader.content).stop();
        tl.removeChild(currentLoader);
        SoundMixer.stopAll();
        MovieClip(currentLoader.content).mute();
        currentLoader = tl["loader_"+0];
        tl.addChild(currentLoader);
        if(playpause_mc.currentFrame==1){
            MovieClip(currentLoader.content).gotoAndPlay(1);
        } else {
            MovieClip(currentLoader.content).gotoAndStop(1);

  • Dynamic plug-ins: How to dispatch MediaFactoryEvent.PLUGIN_LOAD after loading external swf

    Hi,
    I'm creating a dynamic OSMF plugin. That plugin needs to load external SWF file before sending the PLUGIN_LOAD event to the player.
    How can I override the dispatch of the PLUGIN_LOAD event on my MyCustomPluginPluginInfo custom class ?
    If it's not possible, the solution is to create a new MediaElement within my MyCustomPluginPluginInfo:
    var mediaElement:MediaElement = mediaFactory.createMediaElement( new URLResource(null) ); //the resource is null at this point
    On the player side I add that line when the plugin is loaded successfully:
    //Add listener on Media Element creation
    mediaFactory.addEventListener(MediaFactoryEvent.MEDIA_ELEMENT_CREATE, onMediaElementCreate);
    Is it a god solution or not ?
    Is there another way to do that ?
    Thanks !

    Hello!
    I'm not sure you can do it through loadPlugin stage due to an swf loader is used in factory on that moment.
    As for loading an extra swf "per instance" way I'd rather do it using an element LoadTrait than try to bypass the standard factory way.
    Regards!

  • How to detect the end of an external swf loaded into a container

    Hi,
    I'm having trouble finding a solution for this problem, can somebody help me?
    I have a main swf that will load external swfs into a container. I need to detect the end of the loaded external swf in order to start to load and play a new one into the same container.
    The problem is that i do not know what the length of the external swfs will be, and will have no control over the development of them, so i cannot place a variable at the end of their animation which would allow me to detect from the main movie its end.
    I also cannot rely on the _totalFrames property because the loaded swf might not have all the animation inside its main timeline.
    Is there any way to achieve this goal?
    Thx

    Ok... Its as i thought... unfortunatly...
    Gonna mark your latest post again as possible solution, just in case someone comes with any sort of out of the box thing...
    Thx for your help Kglad

  • How to use semi-transparent mask on external swf?

    I want to use semi-transparent mask on external swf for smooth transition. I'm using
    clip.cacheAsBitmap = true;
    mask.cacheAsBitmap = true;
    clip.setMask(mask);
    Everything works fine. But when I use
    loadMovie("http://www.url.com/movie.swf", "_root.clip");
    clip.cacheAsBitmap = true;
    mask.cacheAsBitmap = true;
    clip.setMask(mask);
    it doesn't work... what am I doing wrong?

    well if your loadMovie is on the same timeline as the code you are setting as mask, then you dont need _root.
    And sorry, I forgot there was an issue with masking the main mc that loadMovie is loading into. So what I did was put clip inside another mc and called that mc "container" so then my code would look like :
    masker.cacheAsBitmap = true;
    container.cacheAsBitmap = true;
    container.setMask(masker);
    container.clip.loadMovie("movietoload.swf");
    download the two swfs attached, and open main.swf to see.

  • How can I add the score of external swfs.

    How can I add the scores of the different levels of the game that I created wherein each level are all different swfs which is loaded by the loader class.

    Thank you! That really helped.

  • Search text in PDF and MS Word document

    Can any body tell me how search text in PDF and MS Word document through Java code, any body has code or any suggestion to give
    Thank You
    Adnan

    Can any body tell me how search text in PDF
    and MS Word document through Java code, any
    body has code or any suggestion to giveYes.
    First, you need to work out how to read each document type from Java.
    E.g, for MS Word you could use Apache Jakarta POI - HWPF: http://jakarta.apache.org/poi/hwpf/index.html
    Then, you use Apache Lucene to index and search.
    See http://lucene.apache.org/java/docs/index.html
    ~D

  • Trigger events based on current frame of flash movie

    I have a director project with qt video where actions are triggered based on specific times in the video (movietime and/or duration). I am updating this project to use flash video instead of quicktime.
    For ease of development, and hopefully minimal coding changes, I'd like to keep that functionality similar, but I can't figure out how to capture the current frame of the flash movie sprite.
    Can anyone help? or suggest a workaround?

    I can't figure out how to capture the current frame of the flash movie sprite.
    You were almost there. Try either of these:
    put sprite("flash").currentFrame
    -- or
    put sprite("flash").frame

  • How to Load/Unload external SWF

    Hey all, I'm in a desperate struggle to meet a deadline for college coursework. I am unable to UNLOAD an external SWF file that I have put inside another SWF file. The problem that is occurring is, although it loads successfully, when I attempt to navigate to another page after viewing the external SWF, I expect it to close as it goes on to another page however, it remains in place. If i then go back on to the page that it is loading from, it will start to keep adding more and more SWF's. The print screens should explain it easier... Below i'll post the code that I'm using currently. The external SWF I am trying to load/unload is an interactive hangman game (whether it being interactive has an effect I do not know), but any and all help with this would be seriously appreciated!
    The code currently being used is:
    var _swfLoader:Loader;
    var _swfContent:MovieClip;
    loadSWF("Real Hangman.swf");
    function loadSWF(path:String):void {
       var _req:URLRequest = new URLRequest();
       _req.url = path;
       _swfLoader = new Loader();
       setupListeners(_swfLoader.contentLoaderInfo);
       _swfLoader.load(_req);
    function setupListeners(dispatcher:IEventDispatcher):void {
       dispatcher.addEventListener(Event.COMPLETE, addSWF);
       dispatcher.addEventListener(ProgressEvent.PROGRESS, preloadSWF);
    function preloadSWF(event:ProgressEvent):void {
       var _perc:int = (event.bytesLoaded / event.bytesTotal) * 100;
       // swfPreloader.percentTF.text = _perc + "%";
    function addSWF(event:Event):void {
       event.target.removeEventListener(Event.COMPLETE, addSWF);
       event.target.removeEventListener(ProgressEvent.PROGRESS, preloadSWF);
       _swfContent = event.target.content;
       _swfContent.addEventListener("close", unloadSWF);
       addChild(_swfContent);
    function unloadSWF(event:Event):void {
       _swfLoader.unloadAndStop();
    removeChild(_swfContent);
       _swfContent = null;
    This printscreen is showing what it looks like in the Flash view (plain background and external SWF loads when this SWF is published)
    What it looks like when loaded as published swf
    Picture of the external SWF working inside the other SWF
    Picture of it not being able to unload when i navigate to another page!
    Finally, a picture of it doubling up when i proceed to go on the 'game' page again, it just keeps loading the SWF's rather than unloading them!

    for example, file1 consits of two buttons, and also considered as main page. As i click on these two buttons , it will lead me go to open the external file2.swf, and file3.swf respectively. (file2.swf and file3.swf could have other navigation buttons, however, i am just simplify here).
    the code you provided is working fine. but i want to totally remove/unlink the orginal file (file1.swf) when i click on either buttons which could lead me to other page (file1.swf or file2.swf).
    Besides that, in file2.swf and file3.swf could have another "back" button to turn it back to the main page (file1.swf). When the user click on that back button, the file2.swf will unloaded...and file1.swf will be called back again...
    can it  be done?
    so sorry if my poor explanation makes you confuse..
    thank you.

  • QuickTime Applescript Dictionary property for luminance on current frame

    Anyone know if there is a way to reference the luminance of the current frame via the Applescript dictionary?
    Or know of a scope application that applescript can use to get the luminance?

    I can't figure out how to capture the current frame of the flash movie sprite.
    You were almost there. Try either of these:
    put sprite("flash").currentFrame
    -- or
    put sprite("flash").frame

  • I want to load external swf in movieclip and next external swf should load Automatically

    I want to load external swf in movieclip and next external swf should load Automatically when current swf is finished in AS3.
    How can we can check total frame and current frame of imported swf in a movie clip.
    any help will be appreciated
    regards,
    Jatin Dembla

    in as3 you use the loader class (not movieclips) to load external swfs.
    you can use an Event.COMPLETE event listener (applied to the loader's contentLoaderInfo property) to check when loading is complete and start the next swf loading.
    you can use the loader's content property (caste as a movieclip) to determine info (including totalFrames) about the loaded swf's main timelnie (once loading is initialized, for the totalFrames, or complete, for some other properties like height and width).
    var loader:Loader=new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadcompleteF);
    loader.load(new URLRequest("swf1.swf"));
    var loadedSWF:MovieClip;
    function loadcompleteF(e:Event):void{
    loadedSWF=MovieClip(loader.content);
    trace(loadedSWF.totalFrames);

  • Getting external swf to stay visible?

    Hi
    I have an external swf that contains a button that controls my main swf's timeline.
    I can get it to navigate fine, but as soon as it navigates, my external swf disappears, because my main swf is no longer on the frame my external swf was imported on.
    How do I get the external swf to stay visible along all the frames of my main swf's timeline?
    Here's the code I use to import the external swf:
    var external_swf:MovieClip;
    var loader:Loader = new Loader();
    var import_me_SWF:URLRequest = new URLRequest("external_mc.swf");
    loader.load(import_me_SWF);
    loader.x = 0;
    loader.y = 0;
    addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataOnLoad);
    function dataOnLoad(evt:Event): void {
    external_swf = MovieClip(evt.target.content);
    Thanks guys.
    Shaun

    SOLUTION:
    Ok - here's a solution I experimented with for anyone that needs a similar fix:
    1. Create a new layer where you would like the external swf to go (in my case, the layer is on the top).
    2. Draw a rectangle (doesn't matter what it is really), convert it to a movieclip symbol, and give it a color effect APLHA of 0 so it's invisible.  Give it an instance name - I named mine 'external_swf_holder'
    3. Adapt the external loader code like this...add 'external_swf_holder' to the beginning of the external clip name, with a dot in between:
    var external_swf:MovieClip;
    var loader:Loader = new Loader();
    var  import_me_SWF:URLRequest = new URLRequest("external_mc.swf");
    loader.load(import_me_SWF);
    loader.x  = 0;
    loader.y = 0;
    addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,  dataOnLoad);
    function  dataOnLoad(evt:Event): void {
    external_swf_holder.external_swf =  MovieClip(evt.target.content);
    4. That's it.  Now Flash should always keep your swf on the layer that 'external_swf_holder' is on.
    Cheers
    Shaun

  • Loading external SWF with masked content - get size of masked area

    I am loading an external swf using the SWFLoader component. The swf that is being loaded is masked so that only a portion is being shown. However, when it's loaded the actual size of the swf (loader.content.width && loader.content.height) is the complete swf including the masked area. Therefore, the loaded swf does not display properly in the itemrenderer Is there a way to to grab the size of the just the masked area as opposed to getting the size of the entire swf's contents (area not masked)?
    One item to note that is complicating the issue, is that these are swf files that have already been created and there are many of them. In some instances, the size of the stage matches up with the size of the masked area. In other instances, the stage is larger (or possibly smaller) than the masked area movieclip as well as possibly the actual size of the movieclip (w/o the mask).
    I am currently loading the external swf in using a Loader. Once loaded, I make a copy (screen shot) of the swf by creating a bmp of the loader.content.This is done as I don't want to have any animations being shown on screen at this moment. I am setting the size of the bmp using using loader.content.width & loader.content.height. I then set the SWFLoader.source to the bitmap.

    Here's the code I am using to load the swf:
         <fx:Script>
                <![CDATA[
            protected  function application1_applicationCompleteHandler(event:FlexEvent):void {
                 loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onSWFLoaded);
                 loader.load(new URLRequest("c:\\Flex Testing\\FA warns Mr. Jones.swf"),  context);
            private function  onSWFLoaded(event:Event):void {
                bmData=new  BitmapData(loader.content.width, loader.content.height, true, 0x990000);
                 bmData.draw(loader.content, new Matrix());
                bmp=new  Bitmap(bmData);
                swfLoader.source=bmp;
                 addElement(swfLoader);
                with (swfLoader)
                    setStyle('verticalAlign', "middle");
                     setStyle('horizontalAlign', 'center');
                     verticalCenter=0;
                    horizontalCenter=0
                     scaleContent=true;
                    maintainAspectRatio=true;
                     addEventListener(MouseEvent.CLICK,onClick,false,0,true)
                     useHandCursor = true;
                    buttonMode = true;
                     width=200;
                    height=200;
                 loader.unload()
                loader=null;
               ]]>
    </fx:Script>

Maybe you are looking for

  • View for update balance

    How could we create a view in SQL group by account no and would gave us the following results from two tables stock and issue. Or what other solutions we could answer the following problem. A/C      Received Stock     Issued Stock     Balance 1     1

  • Satellite A500 - Battery light flashes when connected to mains power

    Win 7 Satellite A500 PSAM3A-03P00E. The battery light flashes when connected to mains power (intermittent fault), when I unplug mains and re-connect flashing stops and battery (high capacity) continues to charge. Also when battery light flashes the k

  • Help in Editing notes on the score

    This notes thing is cool but editing seems difficult. I must be missing some short cuts. I can play thru the midi and the notes show up. I'd like to tweak them and shift them because what shows as the fourth beat in one measure should be the first be

  • Table fields for Status of an equipment.

    Hi Experts, Can anyone tell me Tables and fields available for Status of an equipment. Which is shown in IE03. i.e. 'INST','AVLB'......etc. Thanks, Ashesh Chokhawala.

  • RMAN status=ORPHAN

    What is the meaning of status=ORPHAN, when i execute the command RMAN> list incarnation of database merlinp; List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time 1142887 1142888 MERLINP 3538586174 ORPHAN 1 06-APR-07