Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-11-2006, 05:25 AM   #1
CisTrans
Registered User
 
Join Date: Jun 2006
Posts: 1
Default Persistant Code Problem

Hi guys. I have a problem that I have been trying to correct for the better part of the morning. Two years ago I began designing a website but have put it aside for about a half year, and when I began working on it last night I noticed that have not been able to replicate a particular aspect of my site successfully- namely the menu buttons.

On my main page I have five menu buttons that permutate onrollover/rollout/onrelease, but when I went to create a second set of buttons identical to these (to expand the choices on my site) I cant seem to make them fall suit with the others I created when I first began the project.

When I went to create this new set, I copied everything down to a T' and altered the code accordingly to the new additions, but the new button that I created simply does not behave as the others.

Among the other content in my main .fla, I have allocated two layers as "buttons" & "mcs".

In the buttons layer, for each button, I have this code:
on(release){
works.destinationY=_root.upPosition; // send work MC into upPosition
process.destinationY=_root.downPosition; // send process and other buttons/MC's into downPosition if they are up. if they're already down, they stay down.
theabode.destinationY=_root.downPosition;
profile.destinationY=_root.downPosition;
portfolio.destinationY=_root.downPosition;
link.destinationY=_root.downPosition;
homage.destinationY=_root.downPosition;
}
on(rollOver){
works.gotoAndPlay(2);
}
on(rollOut){
works.gotoAndPlay(6);
}

on (release) {
gotoAndPlay(82);

}

The new mc' I was trying to create is entitled homage, and its mate- buttonhomage. This code is found on the button- buttonhomage.

In the layer for mcs' I have this code:
startposition=733;
downPosition=733;
upPosition=downPosition-10; // upPosition is 10 spaces above downPosition
works._alpha=0;
process._alpha=0;
theabode._alpha=0;
profile._alpha=0;
portfolio._alpha=0;
link._alpha=0
homage._alpha=0;
buttonworks._visible=false; // do the rest of the buttons like this
buttonprocess._visible=false;
buttontheable._visible=false;
buttonprofile._visible=false;
buttonportfolio._visible=false;
buttonlink._visible=false;
buttonhomage._visible=false;

From this code, homage._alpha=0; & buttonhomage._visible=false; are the new additions I added when trying to create the new menu button "homage".

The code on each respective, self-entitled mc is as follows:
onClipEvent (load){
speed = 5;
destinationY = _root.startPosition; // start in downPosition
}
onClipEvent (enterFrame) {
if(this._alpha!=0){
this._alpha+=2; // alter number up to speed up fade in
}
y = destinationY-_y;
this._y += y/speed;
_parent.buttonprocess._y=this._y; // attach work to work MC
}

Essentially this is all the code I have to connect each mc to its "parent button" and make them work in sync as the user rolls-over and clicks on each button.

The problems I am having are this. The other 6 or so buttons I have work perfectly but with the addition of this new button, which is supposed to be identical in code and structure as the others, I am getting an entirely different behavior from it.

The mc, "homage", as set by "homage._alpha=0;", like the others does not adjust itself according to the code:
onClipEvent (enterFrame) {
if(this._alpha!=0){
this._alpha+=2; // alter number up to speed up fade in

when it and the other buttons enter the same frame. The other buttons work fine but this one doesnt; it stays hidden with an alpha of 0, rather than fade in. I can make it visible by changing it to if(this._alpha!=1 but I dont want that. I want it to stay invisible till the right moment in the script like the others, but instead it appears ahead of schedule if I change it to 1.

The second issue I am having is with the additon of:
buttonhomage._visible=false;
The button that corresponds with the mc of the same name somehow locks up and prevents me from clicking on it rather than follow suit with the rest of the code with the same structure. I simply added this in as per my own notes in the code, thinking that it would work for this new addition.

The third, and final issue I am trying to resolve in an attempt to add more buttons to my site revolves around this code:
startposition=733;
downPosition=733;
upPosition=downPosition-10; // upPosition is 10 spaces above downPosition

My sites dimensions are 1024x768. Both the mcs and their corresponding buttons are located at Ycoord-733. The newly added button, homage, is also placed at Y733 but when I preview the .fla in .swf, homage is higher in orientation that other buttons but it still registers that its at Y-733 like the others. To make it worse, the mc "missfires" and moves in the Y direction its -10 as per the code, upPosition=downPosition-10;, ahead of schedule before the other buttons do.

I am honestly lost and I think if I could figure out one part of this, with anyones help, then I could figure out the rest, but such as it is I am lost, and I am positive all instance names and code are accounted for. I couldnt not attach my .fla due to file type restrictions but I will send a copy of it by email to anyone that thinks they can help, and any help would be greatly appreciated. You may also correspond with me in my included email [email protected]
-Isaiah
CisTrans is offline   Reply With Quote
Reply


Thread Tools
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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Security policy file problem - code works in one swf but not another - port problem? elfranko Server-Side Scripting 0 09-23-2004 02:26 PM
[FMX]i'm stuck - have a problem with a code for navigation gunko2 ActionScript 2.0 1 09-11-2004 06:37 AM
I have a problem with downloading source code and incorporating this within my own fl batfink Server-Side Scripting 1 09-18-2003 11:42 AM
I have a problem with downloading source code and incorporating this within my own fl batfink Other Flash General Questions 1 09-18-2003 09:40 AM
Code Problem: Creating an option where users determine time and date lbower ActionScript 1.0 (and below) 16 01-17-2003 03:00 PM


All times are GMT. The time now is 12:00 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.