Jump to content
Search Community

learner_7n

Members
  • Posts

    131
  • Joined

  • Last visited

Posts posted by learner_7n

  1. Hi,

     

    I am resizing my .swf file according to browser size using AS3. It is working fine. But problem occurs only when an object goes x=-300 (x, or y but in negative numbers) on stage. Means when the object goes up the stage or down the stage, everything on stage shrinks and looks very bad.

     

    How to overcome this problem?

     

    Actually I am having problem only when my flash movie clips move out of flash stage area.

     

    Say, my swf movie width & heights are 600x400 and my flash movie clip (MC-1) animation area is set to animate from x:-100 to y:650 or x:100 to y:-450.

     

    Any help, please. I tried several forums to overcome thim problem but in vain.

     

    Regards.

    Example.zip

  2. I made a very basic example showing how you can use the instance name of the button that is clicked to load the proper swf.

     

    var swf:SWFLoader;
    //buttons have same instance names as the swfs that will load
    services.addEventListener(MouseEvent.CLICK, loadSwf);
    contactus.addEventListener(MouseEvent.CLICK, loadSwf);
    
    function loadSwf(e:MouseEvent):void{
    //if there is previously loaded content then get rid of it
    if(swf){
     swf.unload()
     };
    swf = new SWFLoader(e.target.name + ".swf", {container:SWFContainer_mc, onComplete:completeHandler1, alpha:0});
    swf.load();
    }
    
    
    function completeHandler1(event:LoaderEvent):void {
     TweenMax.to(event.target.content, 1, { alpha:1});
    }
    

     

    files attached

    I made a very basic example showing how you can use the instance name of the button that is clicked to load the proper swf.

     

    var swf:SWFLoader;
    //buttons have same instance names as the swfs that will load
    services.addEventListener(MouseEvent.CLICK, loadSwf);
    contactus.addEventListener(MouseEvent.CLICK, loadSwf);
    
    function loadSwf(e:MouseEvent):void{
    //if there is previously loaded content then get rid of it
    if(swf){
     swf.unload()
     };
    swf = new SWFLoader(e.target.name + ".swf", {container:SWFContainer_mc, onComplete:completeHandler1, alpha:0});
    swf.load();
    }
    
    
    function completeHandler1(event:LoaderEvent):void {
     TweenMax.to(event.target.content, 1, { alpha:1});
    }
    

     

    files attached

     

    Thanks a million for your kind help.

     

    Regards.

  3. Hi,

     

    How to load external SWF files in a specific movie clip based on a button clicked. Say, I have 4 SWF files like ...

    1) Main.swf

    2) Services.swf

    3) AboutUs.swr

    4) ContactUs.swf

     

    And I have the buttons with same name like (Main, Services, AboutUs & ContactUs) and when I cllick on Services button the Services.swf to be loaded.... so on...

     

    Actually I have several external SWF files to load in this way.

     

    The following code is okay but I need to write code for each button seperately. How can I modify the code to resolve my problem?

     

     

    var mySwf1:SWFLoader = new SWFLoader("Main.swf", {width:600, height:400, container:SWFContainer_mc, onComplete:completeHandler1});
    
    mySwf1.load();
    
    function completeHandler1(event:LoaderEvent):void {
    TweenLite.to(event.target.content, 0,{alpha:0});
    TweenMax.fromTo(event.target.content, 3, {x:0, y:0, width:600, height:400, alpha:.5}, {x:0, y:0, width:600, height:400, alpha:1, delay:1});
    }
    

     

    Thanks in advance for any help.

     

    Regards.

  4. Hi,

     

    I have the following code which is working fine:

     

     
    var mySwf1:SWFLoader = new SWFLoader("HandBook.swf", {width:600, height:400, container:this, onComplete:completeHandler1});
    
    mySwf1.load();
    
    function completeHandler1(event:LoaderEvent):void {
    TweenLite.to(event.target.content, 0,{alpha:0});
    TweenMax.fromTo(event.target.content, 3, {x:0, y:0, width:600, height:400, alpha:.5}, {x:0, y:0, width:600, height:400, alpha:1, delay:1});
    }
    

     

    The question is, how can I modify the below line of code to load this "HandBook.swf" external file into specific movie clip? Say, I have mc1, mc2, mc3 movie clips and I want to load this "HandBook.swf into mc2 movie clip.

     

    Thanks in advance for any help.

    • Like 1
  5. Hi,

     

    I tried it. But getting the following error:

     

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at Waterfall_fla::MainTimeline/init()

    at Waterfall_fla::MainTimeline/frame1()

     

    The code:

     

      //set up the holder
       var swfHolder:MovieClip = this.mySWF_mc;
    
       //create a LoaderMax named "mainQueue"
       var queue:LoaderMax = new LoaderMax({name:"mainQueue"});
    
       //load the SWF into its holder
    queue.append(new SWFLoader("WaterFall.swf", {name:"WaterFall.swf",container:swfHolder}));
    queue.load();

  6. Hi,

     

    I have the following code on Home Page which contains some tween animations. When I move to About page and immediately come back to Home page again (before all the animations on Home Page done animation), I see some animations are still in the middle of completion. Actually I should see the animation from starting when I go to Home page from any section.

     

    var timeline3:TimelineMax = new TimelineMax();
    timeline3.append(TweenMax.fromTo(Home_mc, 1, {x:1000, y:0, alpha:.8}, {x:0, y:0, alpha:1, delay:.5, ease:Elastic.easeOut}));
    
    timeline3.append(TweenMax.fromTo(Home_mc.Character_mc, .5, {x:435, y:-600, alpha:.8}, {x:435, y:200, alpha:1, delay:0, ease:Regular.easeOut}));
    timeline3.append(TweenMax.fromTo(Home_mc.Birds_mc, .5, {x:660, y:600, alpha:.8}, {x:660, y:200, alpha:1, delay:0, ease:Regular.easeOut}));

     

    How to solve this problem?

     

    Please help.

×
×
  • Create New...