www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > Multimedia

    Multimedia For discussion of all manner of media (audio, video, flash) techniques, as they relate to the web.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 03-28-2007, 11:15 PM
    tomyknoker tomyknoker is offline
    Registered User
     
    Join Date: May 2003
    Location: Australia
    Posts: 368
    Fading My Loaded MC Before Going To FrameLabel

    I have the below code:

    Code:
    numOfBtn = 6;
    stop();
    for (i=0; i<numOfBtn+1; i++) {
    	this["btn"+i].num = i;
    	this["btn"+i].onRelease = function() {
    		gotoAndStop("frm"+(this.num+1));
    	};
    	this["btn"+i].onRollOver = function() {
    		this.play();
    	};
    	this["btn"+i].onRollOut = function() {
    		this.onEnterFrame = function() {
    			if (this._currentframe != 1) {
    				this.prevFrame();
    			} else {
    				delete this.onEnterFrame;
    			}
    		};
    	};
    }
    I have six buttons, which animate onRollOver and reverse the animation onRollOut... onRelease it sends it to 'frm1-frm6' respectively depending on which button is pressed. Say for example btn1 is pressed and the user is taken to framelabel 'frm1'. On each framelabel I have this code:

    Code:
    var myTest = "images/manly/manly" + 2 + ".jpg";
    _root.myLoader.loadClip(myTest,_root.myClip);
    This loads a bg image, onto the stage. It calls myClip which plays from allpha 0-100. This is the code for myClip, so you can se what it does:

    Code:
    var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
    var myLoader = new MovieClipLoader();
    var myListener = new Object();
    var myTest = random(6) + ".jpg";
    
    Stage.align = "TL"; // Position the movie at top, center
    Stage.scaleMode = "noScale"; // Prevent scaling (required!)
    
    myListener.onResize = function (e:Object):Void {
    	var sw:Number = Stage.width;
    	var sh:Number = Stage.height;
    	mcl._width = sw;
      	trace("New width: " + Stage.width);
    };
    
    myListener.onLoadInit = function (mcl) {
    trace("load init");
    mcl._alpha=0;
    mcl.onEnterFrame=function(){
    mcl._alpha +=15;
     
    if(mcl._alpha >=100){
    delete mcl.onEnterFrame;
    }
    }
    };
    
    Stage.addListener(myListener);
    myLoader.addListener(myListener);
    myLoader.loadClip(myTest,myClip);
    Basically after all that! What I want to try and do is when 1 of the 6 buttons is pressed and it moves to a framelabel and loads the image into 'mcl', before it does this I want the old loaded image to fade out and then for the playhead to move to the new framelabel... Sorry it's really hard to explain on here sometimes... If anyone understands and can help me out would be much appreciated!
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:16 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.