add new button to flash xml menu

  • sagonus
  • Born
  • Born
  • sagonus
  • Posts: 1

Post 3+ Months Ago

Hello everybody! I have a template and I want to add a menu button which is inside the flash and the text loaded externally via XML. In a flash, I placed the control and copy and paste a new button, but when displayed, I repeat that I copied text of the button. Here is my XML code
I'm using Flash CS4 and ActionScript 2.0 and Flash Player 10

Code: [ Select ]
<! - Menu ->
<section name="menu">

<link systemOrder="1"> [CDATA [
PORTFOLIO
]]></ link>

<link systemOrder="2"> [CDATA [
BIOGRAPHY
]]></ link>

<link systemOrder="3"> [CDATA [
SERVICES
]]></ link>

<link systemOrder="4"> [CDATA [
CONTACT
]]></ link>

<link systemOrder="5"> <! [CDATA [
THINGS
]]></ link>

</ section>
  1. <! - Menu ->
  2. <section name="menu">
  3. <link systemOrder="1"> [CDATA [
  4. PORTFOLIO
  5. ]]></ link>
  6. <link systemOrder="2"> [CDATA [
  7. BIOGRAPHY
  8. ]]></ link>
  9. <link systemOrder="3"> [CDATA [
  10. SERVICES
  11. ]]></ link>
  12. <link systemOrder="4"> [CDATA [
  13. CONTACT
  14. ]]></ link>
  15. <link systemOrder="5"> <! [CDATA [
  16. THINGS
  17. ]]></ link>
  18. </ section>


The 5 button should say "things" is repeated again and my "portfolio" that is the button you copied. The AS code of each button is the same at all, just change the number of "num" for 1, 2, 3, 4 and add 5...

Code: [ Select ]
onClipEvent (load)
(
num = 1;
this.title1.gotoAndStop (num);
this.title2.gotoAndStop (num);
this.sq1.gotoAndStop (num);
this.sq2. gotoAndStop (num);
)
on (rollOver)
(
if (_root.link <= num)
(
this.gotoAndPlay ( "s1");
) / / End if
)
on (releaseOutside, rollOut)
(
if (_root.link <= num)
(
this.gotoAndPlay ( "s2");
) / / End if
)
on (release)
(
if (_root.link <= num _root.animation == 1)
(
_root.animation = 0;
_root.link_prev = _root.link;
_pare not [ "item" + _root.link]. gotoAndPlay ( "s2");
_root. link = num;
_root.pics_blur_alpha (0);
_root.play ();
) / / End if
)
  1. onClipEvent (load)
  2. (
  3. num = 1;
  4. this.title1.gotoAndStop (num);
  5. this.title2.gotoAndStop (num);
  6. this.sq1.gotoAndStop (num);
  7. this.sq2. gotoAndStop (num);
  8. )
  9. on (rollOver)
  10. (
  11. if (_root.link <= num)
  12. (
  13. this.gotoAndPlay ( "s1");
  14. ) / / End if
  15. )
  16. on (releaseOutside, rollOut)
  17. (
  18. if (_root.link <= num)
  19. (
  20. this.gotoAndPlay ( "s2");
  21. ) / / End if
  22. )
  23. on (release)
  24. (
  25. if (_root.link <= num _root.animation == 1)
  26. (
  27. _root.animation = 0;
  28. _root.link_prev = _root.link;
  29. _pare not [ "item" + _root.link]. gotoAndPlay ( "s2");
  30. _root. link = num;
  31. _root.pics_blur_alpha (0);
  32. _root.play ();
  33. ) / / End if
  34. )


What is the problem?? :(
Moderator Remark: added code formating
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

i don't know exactly how the template works, but if it doesn't generate the buttons dynamically, meaning only one button in the library which is reused, then you should probably check the instance of the newly created button.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.