Timeline like navigation  using tween class

I am a beginner, please help!
So I want to create a timeline nav like this site:
http://us.leica-camera.com/photography/m_system/m9/
timeline is a 40 x 40px color filled movie clip that use as the playhead. 
featContent is the movie clip that contains the feature content.
I make the timeline controls the feature contents to slide (using tween class) to the next feature. No problem on this, but I can't make the feature to slide when click on the button.
Please shed some lights!  Thank you very much!
function loadFeature(node){
      var m = 0;
      this.createEmptyMovieClip("featNav",50);
      this.timeline._xscale = 1;
     this.createEmptyMovieClip("featContent",10);
      this.featNav._x = featNav_x;
      this.featNav._y = featNav_y;
      featl = node.childNodes.length;
           fBtnW = (featNav_w/featl);
           duration = 10*featl;
      for(var x=0; x < featl; x++){
           //create nav buttons
           feat[x] = node.childNodes[x];
          this.button = this.featNav.attachMovie("menu_btn","featBtn"+x,x+  1);
           this.button.menu_txt.text = feat[x].attributes.name;
           this.button.menu_txt.embedFonts = true;
           this.button.menu_txt.autoSize = true;
           this.button.menu_txt.setTextFormat(menuTxtFmt);
           this.button.mask_mc._width = this.button.menu_txt._width;
           this.button._x = 20 + fBtnW*x;    
          this.button.curNum = x;
           //onClick
           this.button.mask_mc.onRelease = function(){
                if (this._parent._parent._parent.overlay._y > -this._parent._parent._parent.overlay._height){
                     removeOverlay();
                feat = this._parent._parent._parent.featContent;
               count = this._parent.curNum;
                newX = -Stage.width*count;
                moveTimeline = new Tween(this._parent._parent._parent.timeline, "_xscale", None.easeIn, (422*count), 1850, (duration-10*count), true);
                slideFeature = new Tween(feat, "_x", Regular.easeOut, feat._x, newX, 0.4, true);
           var t_listen = new Object;
           t_listen.onMotionChanged = function(target){
           if (count == 0){
                for(var i=0; i < featl; i++){
                     if (target.obj._xscale > (422*i)){
                          newX = -Stage.width*i;
                          slideFeature = new Tween(target.obj._parent.featContent, "_x", Regular.easeOut, target.obj._parent.featContent._x, newX, 0.4, true);
           var moveTimeline:Tween;
           moveTimeline = new Tween(this.timeline, "_xscale", None.easeIn, 1, 1850, duration, true);
           moveTimeline.onMotionFinished = function(){
                     moveTimeline.start();
      moveTimeline.addListener(t_listen);

Nevermind, I think I found what I needed. Thanks guys!

Similar Messages

  • Is it flash bug? Tween Class

    I've been working on a bit big project. I've some components on the stage. There are basically 4 frames. Each frame has some components. What I've done is, I've used tween class. Workflow is something like this:
    Frame 1:
    --used Tween class to get fade effect for List component.
    --used Tween.MOTION_FINISH event to fire an event when it is finished.
    --when it is finished, applied eventListener
    --on Change event, remove eventListeners and use Tween class again to get reverse fade effect.
    --again used Tween.MOTION_FINISH event to fire an event when finished.
    --in that evenHandler, gotoAndStop(2);
    Frame 2:
    //similar
    Frame 3:
    //similar
    and so on.. now, what happens, is, if i play with my scene, sometimes tween class failed to work. sometimes it does not display List component, sometimes it displays List component with alpha 0.2. sometimes it happens with movieClip also. Is it flash bug or problem with my code?

    probably a coding problem.  the most common error that seems like a flash bug would be to define a tween within a function body allowing flash to gc that tween, possibly before it starts and/or completes.

  • Using other classes in jsp

    hi all.
    in my jsp i would like to use another class which i created.
    here's what im trying to do:MyUtils.getValue(request.getParameter("id"));i'm getting: MyUtils cannot be resolved
    in MyUtils the method getValue is static.
    where should i put this class in order for my jsp to know it?
    thanks.

    Did you include a page directive with an import for the package? You need something like:
    <%@ page  import="MyUtilsPackage.*" %>The package containing the class should be placed in the WEB-INF\classes directory. For example if the package name is MyUtilsPackage, you'll need a MyUtilsPackage directory under classes and then put the class into the MyUtilsPackage directory.

  • Tween class trouble

    I don't use Tween class often, so don't scold me if this is
    an obvious question.
    When I set up a simple Tween, it works if I assign a specific
    object's instance name as the object to tween. But when doing it
    inside a for loop, it doesn't work. Yet everything else within the
    for loop works. I've tested every variable, and it's the object
    name that doesn't work. Here is a simplified version of the code.
    Someone please tell me what I've done wrong.

    Walter,
    > When I set up a simple Tween, it works if I assign a
    specific
    > object's instance name as the object to tween. But when
    > doing it inside a for loop, it doesn't work.
    Interesting. Honestly, your code looks fine. I just
    copy/pasted,
    literally, and it worked as expected.
    I did notice one parameter that might cause some confusion.
    In this
    line:
    var letterUp:Tween = new Tween(this, "_x", Bounce.easeOut,
    this._x,
    this.startX, 2000);
    ... that last parameter, 2000, means the tween will progress
    *very* slowly,
    as it will transpire over the duration of 2000 frames. In a
    standard 12dps
    movie, the full tween would take over 166 seconds. I'm
    wondering if you
    meant 2000 in terms of milliseconds? For that, you could drop
    it to 2, and
    add one more parameter, true, to indicate you want the tween
    to transpire in
    terms of seconds (true), rather than frames.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Passing argument to, when using one class for multiple assets

    I had a class that I was passing a simple argument to like so:
    var quiz_1_2:CaseStudyQuiz = new CaseStudyQuiz(2);
    addChild(quiz_1_2);
    I now would like to use this class for multiple MCs in my library. I thought I could let Flash create a class for each of them and specifying the CaseStudyQuiz class as the Base class. When I do that, I get the following error:
    1136: Incorrect number of arguments.  Expected 0.
    Obviously this is because the class created by flash does not except an argument. Does that mean, I would have to create a seperate class for each of the movies that use that class? And if so, what would I have to do in that class for it to except the parameter and pass it on to my base class?
    Thank you very much for any help with this!!!

    use the super() function and pass your parameter.  but you still might get a runtime error but i don't think that will cause a problem.

  • Error Message When Using a Class Files to Control Navigation

    This is my first attempt at using a class file in a flash project. My intent is to keep all of my navigation elements in class file called "Navigation".  However, I keep getting an error message when I publish.
    I am using a button to go back to the main screen and I gave that button the instance name of "bnt_home". I have also linked that button in the library to the class "Navigation".
    Here is the code:
    package
        import flash.display.SimpleButton;
        public class Navigation extends SimpleButton
            public function Navigation()
                bnt_home.addEventListener(MouseEvent.MOUSE_DOWN, goNavigation);
            private function goNavigation(event:MouseEvent):void
                gotoAndPlay(1,"Main");

    When I changed the code I got error (1046: Type was not found or was not a compile-time constant: MouseEvent).
    package
        import flash.display.SimpleButton;
        public class Navigation extends SimpleButton
            public function Navigation()
                this.addEventListener(MouseEvent.MOUSE_DOWN, goNavigation);
            private function goNavigation(event:MouseEvent):void
                root.gotoAndPlay(1,"Main");

  • ALV like LIST GRID BLOCKED and HIRARCHIC using oops class SALV

    Hi ,
    Can any one let know me is it possible to display all the Flavours of ALV like LIST GRID BLOCKED and HIRARCHICAL
    using oops class CL_GUI_ALV and class CL_SALV.
    and the relevant events with respect to the type of ALV.
    regards

    Hello
    Have you had a look at the documents of Rich Heilman:
    [ALV Object Model - Simple 2D Table - Event Handling|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01]
    [ALV Object Model - Hierarchical Sequential List - The Basics|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0f03986-046c-2910-a5aa-e5364e96ea2c]
    [ALV Object Model - Simple 2D Table - The Basics|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/eac1fa0b-0e01-0010-0990-8530de4908a6]
    Regards
      Uwe

  • HI, I would like to use GPS with I Pad for navigation when I am trekking.  I will need to download maps in order to do this.  Can anyone tell me which I Pad is the one to purchase?  Thanks, Dave

    HI,
    I would like to use an I Pad for navigating when I am trekking in the UK and in Europe.  I would also like to download local maps.
    Does anyone know which I Pad will support GPS Navigation?
    Thanks
    Dave

    Wi-Fi only iPads do not have the GPS chip and rely on inaccurate methods to determine location. So a cellular iPad is a must even if you do not set up a cellular data account.
    Also downloaded maps take up space on the iPad. So I would suggest that you consider an iPad with storage greater that the base model.

  • Tween class and using variables

    I'm having trouble using a variable as the 1st paramenter in
    the Tween class.
    // f2_mc is the name of the clip to be tweened
    on (press) {
    _global.mcName = MovieClip;
    _global.mcName = f2_mc;
    _root.setXposition();
    function (setXposition) {
    var moveIn:Object = new Tween(_global.mcName, "_x",
    Strong.easeOut, 600, 50, 2, true);
    moveIn.onMotionFinished = function() {
    }

    cl...
    That was great! Works perfectly now. I never would have
    figured out the (_parent.f1) thing. I worked for hours on it and
    was about to adopt a new design approach. This makes it easy...
    thanks a lot!

  • I would like to take excel classes / tutorials (intermediate to advanced) and practice on this computer. Could someone clarify, what software and operating system is needed? Can I just use numbers? Do I need to download Excel for Macs and use Camp Boot?

    I would like to take excel classes / tutorials (intermediate to advanced) and practice on this computer. Could someone clarify, what software and operating system is needed? Can I just use numbers? Do I need to download Excel for Macs and use Camp Boot?

    Numbers is a joke compared to Excel. If I were you I would find a class/tutorial first, find out what they use (and it won't be Numbers) and see if you need the Mac or Windows version of Excel. Note that Excel is not sold as a seperate product from the Microsoft Office suites.
    Clinton

  • Tween class animations - modifying elasticity

    I am fairly new to Flash, and couldn't find the help I needed through a search.
    I am using the Tween class to move objects when buttons are clicked. I am using elastic easing as the animation ends, and it looks ok. But am I able to modify the elasticity at all? I like the effect, but it is a little strong and I would like to reduce the bounce at the end.
    Can I do this, or by using this method of animation am I losing the fine control that I would have by using the timeline and I just have to suck it up?

    Well the easing you provide for the tween is just a reference to a function. So you can search the web and find your own functions. Robert Penner is famous for a large number of really great easing methods. Or you can just muck a bit with the built in functions. I put two small clips on the stage, clip0 and clip1. Then this code:
    import fl.transitions.*;
    import fl.transitions.easing.*;
    var myTween0:Tween=new Tween(clip0,"x",Elastic.easeOut,100,500,2,true);
    myTween0.start();
    var myTween1:Tween=new Tween(clip1,"x",myEase,100,500,2,true);
    myTween1.start();
    function myEase(t:Number, b:Number, c:Number, d:Number):Number {
    return Elastic.easeOut(t, b, c, d, .5, .9);
    The the top one is the default and the lower one is my "modified" version. If you check out the help files for the Elastic classes easeOut method it requires the first four arguments (time, start value, end value of the prop, and duration) as do all tween functions. But the last two a and p are specific to elastic easing. The first is the amplitude of the sine wave and p is the period of the sine wave. I don't know what the units are on either of those, but I'm guessing pixels (or twips) and either seconds or milliseconds. So you could just fiddle with those numbers.
    I'm not sure if there is anyway to send those numbers directly through the Tween constructor -- regardless of whether I used the built in functions or made my own.

  • AS3 air project.. nested button in a movie clip .. trying to use a class script

    I have been tring to have a button in a nested movie clip move the timeline along using a class script attached to the nested movie. I can get the buttons to work on the main timeline with another similar class script, but when I have a button within a nested movie and attach similar code to the movie, it doesn't seem to want to work. This is the class code attached to the nested clip.... I guess can an active listener be called if the button isn't yet being visible yet, and should this be done on the Main class script page for the main timeline? Any help would be great!! Thanks
    package  {
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class Animation extends MovieClip {
            public function Animation() {
                gotoAndStop(1);
                negBackground_btn.addEventListener(MouseEvent.MOUSE_UP, buttonPressedNegBackground);
            private function buttonPressedNegBackground(e:MouseEvent):void {
                negBackground_btn.visible = false;
                gotoAndStop("negChar");

    Hi,
    Your question is bit confusing, try to explain it. According to what I unsrestand you should use the particular movieClip name with the code to make it happen properly.
    Like :
    (movieClip_Instance).gotoAndStop("negChar");

  • Tween Class fails

    Hi,
    i was looking for some help with tween class beacuse i have a strange problem. I'm working with AS3, when i test my project, sometimes the Tween fails, sometimes it works. It's really strange, i don't know why. The animation stops before the end point. The most strange for me is why sometimes it works and sometimes no?
    My code is geting a little complex, then i tried to do the same process in a simple model, and the result was the same, i run the model many times, in 5 or 3 % the animation finished before the correct end point. Does anybody with the same problem?
    Thanks in advanced!
    Henrique.

    Thanks clbeech!
    In fact, i was using one code line (var nameTween:Tween = new Tween(...)) and calling this line many times by a Timer event. But, how can i use diferent names for the tween var? May i use a counter like var nameTween[counter]:Tween = new Tween(...)?
    My code is a little big and confuse, i'll try to solve the problem without publish the code. If i don't find a solution, i'll organize it and them put it here.
    Thanks a lot!
    H.

  • Is there a bug in the as3 tween class

    Is there a bug in the as3 tween class that causes tweens to stop before completing. I read that there is and that a 3rd party tween class should be used. I'm just starting out learning as3 and experimenting but this would be good to know when I move onto more complex projects.
    Also the solution for this was to make your function global. Does this simply mean place your function in the top level of your movie.
    I have done research on this topic but I found many conflicting answers.
    Any assistance is welcome thanks in advance.

    the tween declaration (if you need one) must be placed within the scope of the function.  so, if the below function f() is defined in a movieclip, you can use any of the 3 (but don't use the last):
    ///////// most common use ////////////////////////////////////////
    var t:Tween;
    function f(){
    t=new Tween(...)
    /////// next most common use /////////////////////////////////////////
    //no declaration needed because the tween is not referenced anywhere outside the function so need not be assigned a variable
    function f(){
    new Tween(...)
    /////////// least common, not good coding, but possible ////////////
    // var t:Tween;  // declared on the root timeline, for example
    function f(){
    MovieClip(root).t=new Tween(...)
    p.s.  please mark correct/helpful answers

  • Making a complex button with the Tween class...not sure why this isn't working.

    Hi all,
    I'm trying to make a button which scales up on rollover and
    scales down on rollout and I wanted to use the Tween class to do it
    because I'm going to be making a bunch of these buttons and I want
    the code to be as efficient as possible.
    So right now I have a circle in a movie clip, and here's what
    I have on the first frame of that circle's actions layer:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    function grow(who) {
    var tw:Tween = new Tween(who, "_xscale", Strong.easeOut,
    100, 400, 1, true);
    var tw2:Tween = new Tween(who, "_yscale", Strong.easeOut,
    100, 400, 1, true);
    function shrink(who) {
    var tw3:Tween = new Tween(who, "_xscale", Strong.easeOut,
    400, 100, 1, true);
    var tw4:Tween = new Tween(who, "_yscale", Strong.easeOut,
    400, 100, 1, true);
    this.onEnterFrame = function() {
    trace(rewind);
    if (rewind == true) {
    shrink(this);
    this.onRollOver = function() {
    rewind = false;
    grow(this);
    this.onRollOut = function() {
    rewind = true;
    The circle scales up just fine but when I rollout it doesn't
    scale back down. I did a trace to see if my tween was being called
    and sure enough it was. So I did another trace to see if the
    _xscale or _yscale was changing and they both were going down to
    around 290 on rollOut although there's no noticeable difference in
    the size of the button, it just looks like it's sitting there.
    I was also wondering if importing the whole class library
    will add very much to my file size?
    Also, since I'm going to have a lot of these buttons on the
    stage at the same time (these buttons will be like markers all over
    a map so there'll probably be around 50+) would it be a bad idea to
    have that many onEnterFrame checks running simultaneously? Is that
    going to slow the user's CPU way down?

    Thanks for the suggestions guys.
    I tried your code and got the rollOut to work but the button
    blinks rapidly if the user rolls out and then rolls back in
    quickly. Here is a link to the swf:
    http://www.stationarynotes.com/studioI/buttonTest.swf
    It also has to reach a complete stop the first time the
    button expands or else it won't run the shrink function on rollOut.
    I put all of my code on the first frame of the movie clip's
    actions layer so here's what mine looks like:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    function grow(who) {
    var tw:Tween = new Tween(who, "_xscale", Strong.easeOut,
    100, 400, 1, true);
    var tw2:Tween = new Tween(who, "_yscale", Strong.easeOut,
    100, 400, 1, true);
    tw.onMotionFinished=function():Void{
    who.onRollOut = function() {
    shrink(who);
    function shrink(who) {
    var tw3:Tween = new Tween(who, "_xscale", Strong.easeOut,
    400, 100, 1, true);
    var tw4:Tween = new Tween(who, "_yscale", Strong.easeOut,
    400, 100, 1, true);
    this.onRollOver = function() {
    grow(this);

Maybe you are looking for

  • How do I merge multiple windows into 1 window with several tabs?

    In Safari it is possible to merge several open windows into 1 single window, with each window becoming a new tab within the new window, so you can easily switch from tab to tab. I cannot find how to do this in Firefox - does anyone know if it is poss

  • Find my iPhone doesn't Work on my 3GS - It Works Perfectly on my iPad2

    I just got phone support from apple France where I am located for now but they could not solve the problem. Here are the main Problem elements : 1/ Purchased iPhone 3GS in France for use worldwide with on my Chinese Telco SIM ( CHINA MOBILE ) as I li

  • A Query with LOB's requires OCI8 mode, but OCI7 mode is used

    Hello all, I am using Oracle 10g. We have two tables and in that, in one table i have a Long Raw Column and in the other table i have a BLOB field. When i use the select query to fetch the details from the table with Long Raw field it is working fine

  • Word Mail Merge Macro

    Greetings, I have generated the below macro and running it. It's basically a mail merge macro which reads from a fixed file position and emails the document upon prompting the user. It works perfectly except for one small, critical issue. If one of t

  • EPM 11 Services Manual Restart

    I need to restart my EPM 11 system manually. Does anyone have the order in which the EPM 11 services should be started? I have HFM, FDM, Financial Reporting, Workspace, and Shared Services installed. Thank you in advance for your help.s