-
Help >> Dynamic Menu - SQL,PHP,AS
Allright I have an issue which has been plaguing me for awhile now I have a dynamically generated menu
(SQL,PHP,AS)
It has advanced form stage to stage and changed slightly, the jist of it is that it does work fine, the data comes in
creates my movie clip buttons that kick off to different frame labels, only now we would like the activated button to look activated until another of the same buttons is clicked. I have been researching various option none of them have
worked to satisfaction. Using the code below how can I target each duplicated movie clip ? So that I may set the properties of all the "inactive" mc's.
stop ();
openPos = _y
originalPos = _y - (getProperty("link1", _height)*numLinks) - 20;
for (i=2; i<=numLinks; i++) {
duplicateMovieClip ("link1", "link"+i, i);
linkPos = getProperty("link"+i, _y)+(getProperty("link"+i, _height)*(i-1)-1);
setProperty ("link"+i, _y, linkPos);
}
Kindest
Craig
-
Hi,
I am using something similar to that...
the prototype is a two-frame clip where frame 1 has an active button and frame 2 just shows the activated state. The button code is
Code:
on(release) {
// do whatever you need here, like
_root.gotoAndPlay(17);
// common code
_root.setradio(this);
}
with a function on the main timeline
Code:
function setradio(obj)
{ obj.gotoAndStop(2);
for(var j in _root)
if(j.indexOf("link") == 0 && _root[j] != obj)
_root[j].gotoAndStop(1);
}
Musicman
-
Thank you MusicMan
Thank you,
I'll try digest and come back to you.
Kindest
Craig
-
Ok, Ok, Ok
I have not actually got your code working yet but logically I tried something similar, but do not understand how the "button" no longer understands that it is not active when you activate another button.
Kindest and looking forward to any assistance you can offer
Craig
-
Hi,
it is a movieclip with two (key)frames. One of them has an active button, the other one just shows the graphics of the "activated" state.
Now, whenever you click one of those buttons, it goes to the second frame, and the loop will tell all other button clips to go to their first frame
Musicman
-
Menu
Hi Musicman,
Allright, I have got your code to almost work, it is going to the "active" (2nd frame) state of the button, but the buttons are not "deactivating"
- the problem may be targetting for the deactivation. that is
I am targetting 7 different submenus, so on the root I have menu1, menu2,menu3,menu4 etc up to menu 7.
The data for the submenus is loaded and the submenus are only activated when required from a main menu.
So the process for the submenus is as follows:-
Frame 1 - Load the data for the Submenus
Frame 2 - My Submenu MC's exist ( menu1 - menu7 )
The Submenu MC's are made up of the following: 3 frames on the first frame the AS:-
Frame1
stop ();
openPos = _y
originalPos = _y - (getProperty("link1", _height)*numLinks) - 20;
for (i=2; i<=numLinks; i++) {
duplicateMovieClip ("link1", "link"+i, i);
linkPos = getProperty("link"+i, _y)+(getProperty("link"+i, _height)*(i-1)-1);
setProperty ("link"+i, _y, linkPos);
}
Frame3
gotoAndPlay ( 2 );
As well as another MC called:- link1
link1 is made up of the 2 "active" and "none active" frames
I have tried to make the explanation as clear as possible if I have overcomplicated the above please let me know.
I have tried some variation including attempting to target the _root.menu1 [j], but this has not worked.If you can help me get one Submenu working correctly I can figure out the rest.
Any assistance will as always be appreciated.
kindest
-
Menu
Hi Musicman,
Allright, I have got your code to almost work, it is going to the "active" (2nd frame) state of the button, but the buttons are not "deactivating"
- the problem may be targetting for the deactivation. that is
I am targetting 7 different submenus, so on the root I have menu1, menu2,menu3,menu4 etc up to menu 7.
The data for the submenus is loaded and the submenus are only activated when required from a main menu.
So the process for the submenus is as follows:-
Frame 1 - Load the data for the Submenus
Frame 2 - My Submenu MC's exist ( menu1 - menu7 )
The Submenu MC's are made up of the following: 3 frames on the first frame the AS:-
Frame1
stop ();
openPos = _y
originalPos = _y - (getProperty("link1", _height)*numLinks) - 20;
for (i=2; i<=numLinks; i++) {
duplicateMovieClip ("link1", "link"+i, i);
linkPos = getProperty("link"+i, _y)+(getProperty("link"+i, _height)*(i-1)-1);
setProperty ("link"+i, _y, linkPos);
}
Frame3
gotoAndPlay ( 2 );
As well as another MC called:- link1
link1 is made up of the 2 "active" and "none active" frames
I have tried to make the explanation as clear as possible if I have overcomplicated the above please let me know.
I have tried some variation including attempting to target the _root.menu1 [j], but this has not worked.If you can help me get one Submenu working correctly I can figure out the rest.
Any assistance will as always be appreciated.
kindest
-
Hi,
would you want to upload your fla and have the thread moved to the AS forum?
If the movie requires data from php, putting dummy data into a text file might help
Musicman
-
Thanks
Thanks for your response and will do,
I have moved my query across
Kindest and thanks
Last edited by BarryAllen; 01-21-2003 at 11:08 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|