CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 08 Aug 2025 09:16:43 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20080406073613
location: https://web.archive.org/web/20080406073613/https://www.daniweb.com/tutorials/tutorial72820.html
server-timing: captures_list;dur=0.705395, exclusion.robots;dur=0.020495, exclusion.robots.policy;dur=0.007780, esindex;dur=0.010357, cdx.remote;dur=111.077310, LoadShardBlock;dur=259.352492, PetaboxLoader3.datanode;dur=120.010064, PetaboxLoader3.resolve;dur=85.059038
x-app-server: wwwb-app239
x-ts: 302
x-tr: 831
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app239; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 08 Aug 2025 09:16:44 GMT
content-type: text/html; charset=utf-8
x-archive-orig-date: Sun, 06 Apr 2008 07:36:12 GMT
x-archive-orig-server: Apache/2.2
x-archive-orig-x-powered-by: PHP/5.1.6
x-archive-orig-set-cookie: bblastactivity=0; expires=Mon, 06-Apr-2009 07:36:12 GMT; path=/; domain=.daniweb.com
x-archive-orig-cache-control: private
x-archive-orig-pragma: private
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 06 Apr 2008 07:36:13 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 16 Apr 2007 16:54:29 GMT", ; rel="prev memento"; datetime="Thu, 06 Mar 2008 17:22:26 GMT", ; rel="memento"; datetime="Sun, 06 Apr 2008 07:36:13 GMT", ; rel="next memento"; datetime="Sat, 03 May 2008 09:19:55 GMT", ; rel="last memento"; datetime="Mon, 01 Oct 2012 05:39:01 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_2_20080406033321_crawl105-c/51_3_20080406072551_crawl104.arc.gz
server-timing: captures_list;dur=0.422260, exclusion.robots;dur=0.014855, exclusion.robots.policy;dur=0.006054, esindex;dur=0.006855, cdx.remote;dur=8.082824, LoadShardBlock;dur=329.240141, PetaboxLoader3.datanode;dur=377.941743, load_resource;dur=323.902452, PetaboxLoader3.resolve;dur=110.755654
x-app-server: wwwb-app239
x-ts: 200
x-tr: 757
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Flash-XML Menu
Related Forum Threads
Other Web Design Tutorials
Flash-XML Menu
•
•
•
•

What is DaniWeb IT Discussion Community?
You're currently browsing the Web Design Tutorials section within the Web Development category of DaniWeb, a massive community of 306,699 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,171 IT professionals currently interacting right now! If you are in the IT industry or are just a technology enthusiast, you might find just what you're looking for in DaniWeb. Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Web Design Tutorials advertiser: Modernize Legacy Data with Sybase
In this tutorial you will learn how to create a simple menu using Flash, while the menu items themselves will be imported from an XML file called menu.xml.
1. Start by creating a new flash document which can be called anything you like as long as the size is set to 550 x 80 px and the frame rate to 24fps in the property panel as shown below. If you can’t see this, click anywhere on the editing area and press CTRL+F3.
flashmenu001.jpg
2. Next, create a rounded rectangle sized 135 x 40.6px but of any radius, the one shown below is 10 px.
flashmenu002.jpg
3. Now make two layers, the first being ‘actions’ and the second ‘content’ as shown, and then put the rounded rectangle into the contents layer.
flashmenu003.jpg
4. Select the text tool and insert text with a label of ‘label’.
flashmenu004.jpg
5. Set the properties of this text label so that it looks similar to the illustration. The Dynamic Text setting is used so you the label can be changed at runtime.
flashmenu005.jpg
6. Select both text and rectangle, then press F8. You will see the following window, set the properties similar to this and give it an instance name of “old”.
flashmenu006.jpg
7. Convert this to a symbol by pressing F8 and setting name to ‘button_’ while giving it an instance name “label” and now select “button” as shown.
flashmenu007.jpg
8. Add two layers, one “text” and another “button” and then put text into the text layer and your button in the button layer. Convert text to a movie clip by pressing F8 and name it as text. Set the instance name to “label” and add the key frames as shown, selecting key frame 1 from the button layer and pressing F9. Add action script stop(); and then do same with layer 15.
flashmenu008.jpg
9. Now select key frame 15 and then select the rectangle. Set the Color property to Tint, and choose whatever color you want but with an alpha percent of 50%. You will find this option at the right hand side of the color picker when collapsed.
flashmenu009.jpg
10. Repeat step 9, but with the text label.
11. Next, you need to add some ‘motion tween’ by right clicking between the keyframe ‘1 and 15’ and ‘15 and 30’ of both layers one by one and selecting Create Motion Tween.
flashmenu010.jpg
12. Open the Library window by pressing F11 and then right click on the ‘button_’ item. Select linkage and then set properties as given below, checking the export for ActionScript and export in first frame boxes. This helps you to access this object during runtime dynamically.
flashmenu011.jpg
13. In the directory where you have saved this flash document, create an xml file as follows…
14. Now go back to scene one and in the actions layer first keyframe press F9 to open the action panel and then insert the following code:
15. Staying in scene 1, select ‘button_’ and then press F9 to open the action panel again and insert the following code:
16. You can now delete the button if you like and it is stored in the library, available for use anytime. However, you should insert a movie clip which will be shown if your XML file is not found, with an instance name of ‘now’ – it should look something like this:
flashmenu012.jpg
17. Finally, press CTRL+Enter and you should see your finished Flash menu output.
1. Start by creating a new flash document which can be called anything you like as long as the size is set to 550 x 80 px and the frame rate to 24fps in the property panel as shown below. If you can’t see this, click anywhere on the editing area and press CTRL+F3.
flashmenu001.jpg
2. Next, create a rounded rectangle sized 135 x 40.6px but of any radius, the one shown below is 10 px.
flashmenu002.jpg
3. Now make two layers, the first being ‘actions’ and the second ‘content’ as shown, and then put the rounded rectangle into the contents layer.
flashmenu003.jpg
4. Select the text tool and insert text with a label of ‘label’.
flashmenu004.jpg
5. Set the properties of this text label so that it looks similar to the illustration. The Dynamic Text setting is used so you the label can be changed at runtime.
flashmenu005.jpg
6. Select both text and rectangle, then press F8. You will see the following window, set the properties similar to this and give it an instance name of “old”.
flashmenu006.jpg
7. Convert this to a symbol by pressing F8 and setting name to ‘button_’ while giving it an instance name “label” and now select “button” as shown.
flashmenu007.jpg
8. Add two layers, one “text” and another “button” and then put text into the text layer and your button in the button layer. Convert text to a movie clip by pressing F8 and name it as text. Set the instance name to “label” and add the key frames as shown, selecting key frame 1 from the button layer and pressing F9. Add action script stop(); and then do same with layer 15.
flashmenu008.jpg
9. Now select key frame 15 and then select the rectangle. Set the Color property to Tint, and choose whatever color you want but with an alpha percent of 50%. You will find this option at the right hand side of the color picker when collapsed.
flashmenu009.jpg
10. Repeat step 9, but with the text label.
11. Next, you need to add some ‘motion tween’ by right clicking between the keyframe ‘1 and 15’ and ‘15 and 30’ of both layers one by one and selecting Create Motion Tween.
flashmenu010.jpg
12. Open the Library window by pressing F11 and then right click on the ‘button_’ item. Select linkage and then set properties as given below, checking the export for ActionScript and export in first frame boxes. This helps you to access this object during runtime dynamically.
flashmenu011.jpg
13. In the directory where you have saved this flash document, create an xml file as follows…
xml Syntax (Toggle Plain Text)
<xml width="80" horizontal="true"> <menu> <name>Cover</name> <link>https://www.geocities.com/coolvish91</link> <target>_self</target> </menu> <menu> <name>Introduction</name> <link>https://www.geocities.com</link> <target>fr1</target> </menu> <menu> <name>Formatting</name> <link>https://www.yahoo.com</link> <target>_self</target> </menu> <menu> <name>Tables</name> <link>https://www.msn.com</link> <target>_blank</target> </menu> <menu> <name>Frames</name> <link>https://www.adobe.com</link> <target>_parent</target> </menu> <menu> <name>Forms</name> <link>https://www.microsoft.com</link> <target>_parent</target> </menu> </xml>
14. Now go back to scene one and in the actions layer first keyframe press F9 to open the action panel and then insert the following code:
/* SIMPLE FLASH-XML MENU VISHESH YADAV 12/05/2005 */ fscommand("allowscale", "false"); function xmlLoaded(loaded) { if (loaded) { now._visible = false; xmlNode = xmlData.firstChild; total = xmlNode.childNodes.length; name = []; link = []; Target = []; mcWidth = xmlNode.attributes.width; mcHori = xmlNode.attributes.horizontal; for (i=0; i<total; i++) { name[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; link[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; Target[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue; _root.createEmptyMovieClip("_button", i); _root._button.attachMovie("button", button+i, i); } // end of for } else { now._visible = true; now._width = _root._width-20 now._height=(1/7.74)*now._width } // end if } // End of the function now._visible = false; xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.load("menu.xml"); xmlData.onLoad = xmlLoaded;
15. Staying in scene 1, select ‘button_’ and then press F9 to open the action panel again and insert the following code:
onClipEvent (load) { deep = _parent.getDepth(); getWidth = _parent._parent._parent.mcWidth; getHori = _parent._parent._parent.mcHori; if (getHori == "true") { this._width = getWidth; this._height = 0.300000*getWidth; this._x = 10+deep*(this._width+5); this._y = 17; } else { this._width = getWidth; this._height = 0.300000*getWidth; this._x = 10; this._y = 20+deep*(this._height+5); } getLink = _parent._parent._parent.link[deep]; getlabel = _parent._parent._parent.name[deep]; getTarget = _parent._parent._parent.Target[deep]; this.label.label.text = getlabel; } on (release) { getURL(getLink, getTarget); } on (rollOver) { this.gotoAndPlay(2); } on (rollOut) { this.gotoAndPlay(11); }
16. You can now delete the button if you like and it is stored in the library, available for use anytime. However, you should insert a movie clip which will be shown if your XML file is not found, with an instance name of ‘now’ – it should look something like this:
flashmenu012.jpg
17. Finally, press CTRL+Enter and you should see your finished Flash menu output.
•
•
•
•
advertising asp blog browser browsing code community data design development devices domains firefox flash google india internet java laptop legal linux marketing microsoft mozilla multimedia news online php privacy programming reader report research rss sandisk search security sex software streaming sun tutorials video w3c web web development xml yahoo youtube
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
- php socket server - can't connect from flash xml client socket (PHP)
- XML Menu Help - Delaying modules? (Existing Scripts)
- What will a flash xml socket connect to - please help - insanity is near (PHP)
- interact between php and flash using xml (PHP)
- Flash menu is displaying over HTML (HTML and CSS)
- XML and hyperlink as one of the data (XML and SOAP)
Other Web Design Tutorials
- Previous Tutorial: Photoshop: add a white photo frame to your images
- Next Tutorial: Forms: styling text fields with CSS and HTML