# Help me debug my portfolio!

**URL:** <https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896>\
**Category:** design\
**Created:** [May 20, 2008, 8:50pm UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896 "2008-05-20T20:50:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![exid](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@exid](https://forum.kirupa.com/u/exid)\
**Post date:** [May 20, 2008, 8:50pm UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/1 "2008-05-20T20:50:26Z")

</div>

Hi guys,

Here is a rough version of my portfolio. Be gentle.

[http://dma.sjsu.edu/~art101b/jbernardo/portfolio/](http://dma.sjsu.edu/~art101b/jbernardo/portfolio/)

I’m trying to figure out how to fix my menu, which is expanded and closed by if else statements. That is, if \_xmouse reaches a certain point it expands (and the menu instance jumps to frame 30), if \_xmouse leaves that region and the menu instance is at frame 30, then the menu instance jumps to a segment of the timeline in which the menu closes. At the end of this segment menu instance timeline returns to frame 1.

Here is the AS for the menu’s expanding and closing functionality, which is embedded on the menu instance itself:

```auto
onClipEvent (enterFrame) {
    if (this._currentframe == 1) {
        if (_xmouse<30) {
            this.gotoAndPlay(2);
        } else {
            null;
        }
    } else {
        null;
    }
    if (this._currentframe == 30) {
        if (_xmouse>185) {
            this.gotoAndPlay("menuClose");
        } else {
            null;
        }
    } else {
        null;
    }
}

```

The problem is when you scroll out of the menu too fast when it is expanded and roll over another button, the menu gets stuck!

I don’t wanna bog this thread down with all of my AS so I’ll only post it if it’s going to be necessary. What do you guys think could be causing this problem?

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 20, 2008, 9:38pm UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/2 "2008-05-20T21:38:34Z")

</div>

A far better and more simplistic approach would be using something like this

```auto

import mx.transitions.Tween;
import mx.transitions.easing.*;

menuMC.onRollOver = function () {
	var openTween:Tween = new Tween (menuMC, "_x", Strong.easeOut, -75.0, 0, .75, true);
};

menuMC.onRollOut = function () {
	var closeTween:Tween = new Tween (menuMC, "_x", Strong.easeOut, 0, -75, .75, true);
};

```

Obviously that’s just 3 minutes of coding so you can spice it up a bit but I think you’ll be better off that way. One thing you’ll want to do is only allow the rollout effect once the open motion is completed so you don’t get a jerky effect. Or something along those lines.

---

<div class="post-metadata">

**Author:** ![exid](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@exid](https://forum.kirupa.com/u/exid)\
**Post date:** [May 23, 2008, 1:17am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/3 "2008-05-23T01:17:08Z")

</div>

[quote=Digitalosophy;2328862]A far better and more simplistic approach would be using something like this

```
ActionScript Code:
[LEFT][COLOR=#0000FF]import[/COLOR] mx.[COLOR=#000080]transitions[/COLOR].[COLOR=#000080]Tween[/COLOR];

```

[COLOR=#0000FF]import[/COLOR] mx.[COLOR=#000080]transitions[/COLOR].[COLOR=#000080]easing[/COLOR].\*;

menuMC.[COLOR=#0000FF]onRollOver[/COLOR] = [COLOR=#000000] **function** [/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
&nbsp;&nbsp;&nbsp;&nbsp;var openTween:Tween = [COLOR=#000000] **new** [/COLOR] Tween [COLOR=#000000]([/COLOR]menuMC, [COLOR=#FF0000]"\_x"[/COLOR], Strong.[COLOR=#000080]easeOut[/COLOR], -[COLOR=#000080]75[/COLOR].[COLOR=#000080]0[/COLOR], [COLOR=#000080]0[/COLOR], .[COLOR=#000080]75[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#000000]}[/COLOR];

menuMC.[COLOR=#0000FF]onRollOut[/COLOR] = [COLOR=#000000] **function** [/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
&nbsp;&nbsp;&nbsp;&nbsp;var closeTween:Tween = [COLOR=#000000] **new** [/COLOR] Tween [COLOR=#000000]([/COLOR]menuMC, [COLOR=#FF0000]"\_x"[/COLOR], Strong.[COLOR=#000080]easeOut[/COLOR], [COLOR=#000080]0[/COLOR], -[COLOR=#000080]75[/COLOR], .[COLOR=#000080]75[/COLOR], [COLOR=#000000] **true** [/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#000000]}[/COLOR];  
[/LEFT]

Obviously that’s just 3 minutes of coding so you can spice it up a bit but I think you’ll be better off that way. One thing you’ll want to do is only allow the rollout effect once the open motion is completed so you don’t get a jerky effect. Or something along those lines.[/quote]

thanks for your help. i’ve never heard of these classes, i will have to read up on them to understand them more.

---

<div class="post-metadata">

**Author:** ![Anogar](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Anogar](https://forum.kirupa.com/u/Anogar)\
**Post date:** [May 23, 2008, 1:21am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/4 "2008-05-23T01:21:15Z")

</div>

While you’re learning - the Adobe Tween class is awful; it’s slow, unoptimized, and just generally not good. You should check out [[U]TweenLite[/U]](http://www.tweenlite.com).

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [May 23, 2008, 8:49am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/5 "2008-05-23T08:49:09Z")

</div>

the arrow seems to flip when its running around, plus that is generally a bit naff

the zippy stuff is good though

---

<div class="post-metadata">

**Author:** ![exid](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@exid](https://forum.kirupa.com/u/exid)\
**Post date:** [June 3, 2008, 11:20pm UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/6 "2008-06-03T23:20:43Z")

</div>

> [@Anogar;2329832](#):
>
> While you’re learning - the Adobe Tween class is awful; it’s slow, unoptimized, and just generally not good. You should check out [[U]TweenLite[/U]](http://www.tweenlite.com).

hmmm, i’ll take a look at what you suggested. i’d rather stick to what’s already available to me though. is there a place i can read about the adobe tween class? it’s not coming up in the CS3 help directory.

---

<div class="post-metadata">

**Author:** ![Anogar](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Anogar](https://forum.kirupa.com/u/Anogar)\
**Post date:** [June 3, 2008, 11:29pm UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/7 "2008-06-03T23:29:10Z")

</div>

I can understand feeling a little hesitant to use custom classes, but I promise you - TweenLite is basically an industry standard tool, everyone uses it instead of the Adobe classes.

---

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [June 4, 2008, 12:08am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/8 "2008-06-04T00:08:27Z")

</div>

He’s right. Use a tweening class! and TweenLite (or max) is very good. I just made the switch from fuse to tweenmax

---

<div class="post-metadata">

**Author:** ![Fidodo](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@Fidodo](https://forum.kirupa.com/u/Fidodo)\
**Post date:** [June 4, 2008, 12:09am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/9 "2008-06-04T00:09:05Z")

</div>

Trust us on this. I tried using the tween class on a game I was hired to make and it regularly failed. Stopping in the middle of the tween, or not executing at all. I ended up writing one from scratch since it is a really simple class in the first place. The one I wrote pretty much implemented the same exact thing as the Flash class but mine actually worked. Go figure.

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [June 4, 2008, 1:16am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/10 "2008-06-04T01:16:42Z")

</div>

Anogar is correct, he’s a smart guy listen to him.

I make examples like that because it doesn’t require you to download class files. The example was merely a logical example of how I feel you should go about it.

---

<div class="post-metadata">

**Author:** ![snickelfritz](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@snickelfritz](https://forum.kirupa.com/u/snickelfritz)\
**Post date:** [June 4, 2008, 5:25am UTC](https://forum.kirupa.com/t/help-me-debug-my-portfolio/260896/11 "2008-06-04T05:25:25Z")

</div>

I think you’d have a lot of fun coding that navigation triangle with Tweenmax “orient to bezier”. (just download the class and learn it; you’ll be glad you did)

BTW, I like your site.  
I found the triangle to be very interesting and functional; it’s a great idea.
