Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,521 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,827 people online right now. Registration is fast and FREE... Join Now!




3 of the 5 icons go to _alpha = 100; (Not Supposed to Happen)

 
Closed TopicStart new topic

3 of the 5 icons go to _alpha = 100; (Not Supposed to Happen), 3 Icons just decide to go visible

bmcc81
14 Aug, 2008 - 07:11 AM
Post #1

D.I.C Head
**

Joined: 10 Jul, 2007
Posts: 164


My Contributions
HI,

I've got this code that I got from 3D carrousle at Go To And Learn

and I've done a lot of changes to it. It took me awhile, but I've learned a lot doing it.
Well now I'm stuck!!!

What I do is make the cons shrink down to 50% and go 50% alpha, but when I use my top menu to go to an about section, then to my drop down menu, I get a bug that turns 3 out of the 5 icons to 100% alpha. It's supposed to stay 50%.

You can check what I mean here

The code that I'm using for hiding is:

CODE
if(t != this._parent && t!= dDown)
        {
            var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,50,1,true);
            var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,50,1,true);
            var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,50,1,true);                                         // BMCC81 - This turns all icons dark once a icon is selected
            var tw5:Tween = new Tween(lightOut,"_alpha",Strong.easeOut,100,50,1.5,true);    
            
            // This makes the invisibleBrowseBack go back into the right position
            _level0.invBrowseBack.tween("_x",-10,.5,"easeInQuad");                                                         // bmcc81}
            
            var Move_invBrowseBack:Tween = new Tween(invBrowseBack, "_x", Regular.easeOut, -320, 0, 1, true);            // bmcc81}
        }


I've attached the whole file. I don't really think the problem is there. I'm just not sure where it could be.


I think the problem could be also in my drop down menu or my upperMenu????

I'm not really sure. If some one could spare the time and have a look it would be appreciated.
Thanks in advance

User is offlineProfile CardPM
+Quote Post

bmcc81
RE: 3 Of The 5 Icons Go To _alpha = 100; (Not Supposed To Happen)
14 Aug, 2008 - 08:14 AM
Post #2

D.I.C Head
**

Joined: 10 Jul, 2007
Posts: 164


My Contributions
Now I'm thinking that it has something to do with when I explode the icons into the air. Something Happens Here:

CODE
function explosion()
{
    // initalize the counter of MP3
    mp3count++;
    
    trace("---- deactivating actions for the button while EXPLOSION ------");
    for(var i=0;i<numOfItems;i++)
    {
        var t:MovieClip = menuHolder["item"+i];

        //deactivate the buttons
        delete t.icon.onRollOver;
        delete t.icon.onRollOut;
        delete t.icon.onRelease;
        
        // we store the x and y position for each of the items of the menu
        // to be able to bring back all the elements in place when needed.
        t.xPos = t._x;
        t.yPos = t._y;
        
        // random target position
        var tempNB:Number = randRange(0,1);
        if(tempNB>0)
        {
            t.yBoom = tempNB * 1000;
        }
        else
        {    tempNB = -1;
            t.yBoom = tempNB * 1000;
        }
        
        // tweening all the players to their respective random target
        t.tween("_y", t.yBoom, 0.5, "easeOutQuad", 0.05*i);
        
        t.alphaTo(0,0.5,"easeOutExpo", 0.05*i,endExplosion);
    }
}

function endExplosion()
{
    mp3count++;
    //playerVisible = true;
    
    // if mp3count = numOfItems, all the players are out of the scene and unvisible,
    if(mp3count >= numOfItems)
    {
        // sets the mp3Exploding var to false
        mp3Exploding = false;
                
        //sets the property of the menu to false        
        playerVisible = false;

        trace("player visible : " + playerVisible);
        trace("mp3Exploding : " + mp3Exploding);
        trace("mp3 items are out of the scene and de-activated");
    }
}



I know this because when I comment the line out
CODE
t.alphaTo(0,0.5,"easeOutExpo", 0.05*i,endExplosion);

Then I don't get the Bug.
Can anyone see my problem?
Thanks,
User is offlineProfile CardPM
+Quote Post

bmcc81
RE: 3 Of The 5 Icons Go To _alpha = 100; (Not Supposed To Happen)
14 Aug, 2008 - 12:15 PM
Post #3

D.I.C Head
**

Joined: 10 Jul, 2007
Posts: 164


My Contributions
Okay, Now new direction.

I think it happens when I do the implode(). I remember fooling around to get results for something else to work, but now I think it's backfired.

This is the whole function:

CODE
function implode()
{
    home.tooltip._alpha = 100;
    
    home.titleHolder.loadMovie("title.swf");
    
    // sets the mp3Imploding var to true
    mp3Imploding = true;
    trace("mp3Imploding : " + mp3Imploding);
    
    // initalize the counter of MP3
    mp3count = 0;
    trace("mp3 items are scrolling");
    
    //---------- if the menu of mp3 players is not visible
    if(!playerVisible)
    {
        // brings back the mp3items at their initial state : _y = 0 , _alpha = 100;
        for(var i=0;i<numOfItems;i++)
        {
            var t:MovieClip = _level0.menuHolder["item"+i];
            
            t.alphaTo(100, 0.19,"easeInQuad", 0.9*i, mp3ScrollBack1);                    //These values help you get the look you want for the imploding
            //mp3ScrollBack();
            
            t.icon.onRollOver = Delegate.create(t.icon,over);
            t.icon.onRollOut = Delegate.create(t.icon,out);
            t.icon.onRelease = Delegate.create(t.icon,released);
            // sets the mp3Imploding var to false;
            mp3Imploding = false;
        
        //sets the property of the menu back to visible        
        playerVisible = true;
        
        trace("player visible : " + playerVisible);
        trace("mp3Imploding : " + mp3Imploding);
        trace("mp3 items are scrolling");
        }
    }
    
    //---------- else the menu of mp3 players is already visible waiting
    else
    {
        trace("menu of mp3 players is already visible, no implosion necessary !");
        //home.titleHolder.loadMovie("title.swf", "_level10");
        
        // sets the mp3Imploding var to false;
        mp3Imploding = false;
        
        //sets the property of the menu back to visible        
        playerVisible = true;
        
        trace("player visible : " + playerVisible);
        trace("mp3Imploding : " + mp3Imploding);
        trace("mp3 items are scrolling");
    }
}


But this is where things are getting screwy:

CODE
//---------- if the menu of mp3 players is not visible
    if(!playerVisible)
    {
        // brings back the mp3items at their initial state : _y = 0 , _alpha = 100;
        for(var i=0;i<numOfItems;i++)
        {
            var t:MovieClip = _level0.menuHolder["item"+i];
            
            t.alphaTo(100, 0.19,"easeInQuad", 0.9*i, mp3ScrollBack1);                    //These values help you get the look you want for the imploding
            //mp3ScrollBack();
            
            t.icon.onRollOver = Delegate.create(t.icon,over);
            t.icon.onRollOut = Delegate.create(t.icon,out);
            t.icon.onRelease = Delegate.create(t.icon,released);
            // sets the mp3Imploding var to false;
            mp3Imploding = false;
        
        //sets the property of the menu back to visible        
        playerVisible = true;
        
        trace("player visible : " + playerVisible);
        trace("mp3Imploding : " + mp3Imploding);
        trace("mp3 items are scrolling");
        }
    }



You can see that this is a problem, where I write
CODE
t.alphaTo(100, 0.19,"easeInQuad", 0.9*i, mp3ScrollBack1);                    //These values help you get the look you want for the imploding
            //mp3ScrollBack();


I've pulled a sneaky mission, by commenting out a function. The thing is that I need the icon that's selected to go 100% alpha, but all the rest must go 50% _alpha.


Can anyone tell me a work around?
Thanks,
Bmcc

This post has been edited by bmcc81: 14 Aug, 2008 - 12:28 PM
User is offlineProfile CardPM
+Quote Post

bmcc81
RE: 3 Of The 5 Icons Go To _alpha = 100; (Not Supposed To Happen)
14 Aug, 2008 - 01:02 PM
Post #4

D.I.C Head
**

Joined: 10 Jul, 2007
Posts: 164


My Contributions
I figured out my problem smile.gif

It was just wrongly written, I guess. I changed the syntax to:

CODE


if(!playerVisible)
    {
        // brings back the mp3items at their initial state : _y = 0 , _alpha = 100;
        for(var i=0;i<numOfItems;i++)
        {
            var t:MovieClip = _level0.menuHolder["item"+i];
            
           // t.alphaTo(100, 0.19,"easeInQuad", 0.9*i, mp3ScrollBack1);         // This is crap           //These values help you get the look you want for the imploding
            //mp3ScrollBack();                                // This is crap
           t.alphaTo(100,.5,"easeOutQuad");           // This is the right way :)
            
            t.icon.onRollOver = Delegate.create(t.icon,over);
            t.icon.onRollOut = Delegate.create(t.icon,out);
            t.icon.onRelease = Delegate.create(t.icon,released);
            // sets the mp3Imploding var to false;
            mp3Imploding = false;
        
        //sets the property of the menu back to visible        
        playerVisible = true;
        
        trace("player visible : " + playerVisible);
        trace("mp3Imploding : " + mp3Imploding);
        trace("mp3 items are scrolling");
        }



Thanks everyone who had a look. Much appreciated anyway. icon_up.gif
User is offlineProfile CardPM
+Quote Post

Closed TopicStart new topic
Time is now: 12/2/08 09:36PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month