[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Scripted Motion Problem

Asked by dtank in Adobe Flash

Tags: easeinoutquad

i'm trying to script an interface for a flash site that uses a kind of mock 3D depth so some objects appear closer to the front than others. These objects all slide along a horizontal plane to leave only one of the five main sections in view at any one time.

Now the issue is that each of the 5 sections contains 4 objects (20 objects in total) and the pathing in the script is dynamic to increment the ._x position of each object. For this i run a while loop to initiate the the doMove function for each section incrementing the section variable each time, problem being that each time the doMove function runs it only runs the last section of the movie and bypasses all other four sections, it's like each time the section number increments it stops the previous function from working in some cases before it even starts to move. is there a way i can slow down the incrementation of the while loop? or any other suggestions on how i can achieve this effect.

I've uploaded an example of the motion at http://www.pollen.com.au/temp/ (you can see that only the red boxes will move when you click the small black boxes)

source file can be downloaded from http://www.pollen.com.au/temp/sliding_motion.zip

the script for this whole project is below:

onClipEvent (load) {
      
      //DEFINE EASING MOTION FUNCTION
      _global.easeInOutQuad = function (t, b, c, d) {
            t /= d/2;
            if (t < 1) return c/2*t*t + b;
            t--;
            return -c/2 * (t*(t-2) - 1) + b;
      };
      
      //REFERENCES ALL MOVIE CLIPS TO BE CONTROLLED
      var objects01:Array = new Array("logo", "logo", "logo", "logo", "logo");
      var objects02:Array = new Array("quote01", "quote02", "quote03", "quote04", "quote05");
      var objects03:Array = new Array("image01", "image02", "image03", "image04", "image05");
      var objects04:Array = new Array("text01", "text02", "text03", "text04", "text05");
      var gotoPos:Array = new Array(0, 250, 550, 750, 950);

      //INVOKED WHEN MAIN NAV IS CLICKED, CYCLES THROUGH ARRAY AND MOVES ALL OBJECTS
      _global.region = function(r){
            t = 0;
            while(t<=5){
                  doMove(t,r); // will currently only run the function on section 5 and not the first 4 sections.
                  t++;
                  
            }
      };
      
      //DOES ALL OBJECTS MOTION A:LOGO B:QUOTE C:IMAGE D:TEXT & CONTENT
      doMove = function(m,r){
            var i=0;
            var thePosA = eval("_parent." + objects01[m] + "._x");
            var thePosB = eval("_parent." + objects02[m] + "._x");
            var thePosC = eval("_parent." + objects03[m] + "._x");
            var thePosD = eval("_parent." + objects04[m] + "._x");
            var theDifA = gotoPos[r] - thePosA;
            var theDifB = (gotoPos[r] * 3) - thePosB;
            var theDifC = (gotoPos[r] * 6) - thePosC;
            var theDifD = (gotoPos[r] * 9) - thePosD;
                  trace("m="+m + " r="+r);
            onEnterFrame = function(){
                  set("_parent." + objects01[m] + "._x" , easeInOutQuad(i,thePosA,theDifA,50));
                  set("_parent." + objects02[m] + "._x" , easeInOutQuad(i,thePosB,theDifB,50));
                  set("_parent." + objects03[m] + "._x" , easeInOutQuad(i,thePosC,theDifC,50));
                  set("_parent." + objects04[m] + "._x" , easeInOutQuad(i,thePosD,theDifD,50));
                  if (eval("_parent." + objects01[m] + "._x") == gotoPos[r]){
                        delete onEnterFrame;
                        var i=0;
                        
                  } else {
                        i++;
                  }
                  
            };
            
      };
      
}
[+][-]03/06/06 09:58 AM, ID: 16116662Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/06/06 10:00 AM, ID: 16116673Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Adobe Flash
Tags: easeinoutquad
Sign Up Now!
Solution Provided By: ivan_os
Participating Experts: 1
Solution Grade: A
 
[+][-]03/06/06 04:42 PM, ID: 16120064Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/06/06 05:21 PM, ID: 16120287Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81