Which is the best way to design Flash site with some content
I am new to flash and just learned some action Script 3 with some events.
I have to build site with开发者_StackOverflow社区 dynamic menus and then contents for each page using xml.
Is there any example on web to show how I can build the site.
What is GAIA , will it help me or I should code my self
Thanks
First, before people starts a "flamewar" against Flash, let me remind you that depending on your usage of the website, you wont get much "help" from Search engines such as Google, if you produce a website in complete Flash.
The SWF files are considered much like graphic, which is hard for computers to make any sense out of automatically.
So unless you do a lot of "pre-thinking" and "tricks" to make the pages of content selectable through normal URL's such as http://www.mywebsite.com/?page_id=home
Then you are in my opinion already on the wrong path.
Think of Flash as "a closed box". What you put in there can look awesome, but it has downsides when producing widespread websites.
Actionscript 3.0 is close to what Javascript (eg. browser script without plugins) and C# (Microsoft .NET) looks like.
Dynamic menus can be produced without Actionscript and Flash. There are loads of ways with DHTML (Dynamic HTML) - have a look at jQuery (www.jquery.com) and all the plugins or UI they have build - for you... for free.
Those will most of the time be "ok" for search engines.
Now... your question:
Actionscript 3.0 - load menu from XML.
First you need to design your XML format, lets say:
<?xml version="1.0" encoding="utf-8"?>
<navigation>
<menu sortorder="1" url="page1.htm" />
<menu sortorder="2" url="page2.htm" />
...
<menu sortorder="99" url="page99.htm" />
</navigation>
From this you can select your "Decandents" called "menu". By reading all these into an array you can build the visual menu. Search for keywords such as: "actionscript, xml, menu" on Google for loads of samples.
Secondly you need some way for "storing" your page contents, so that you have something to show. You havent provided us with much details, so its hard to know if you will use normal HTML pages or just need text.
You can store those into XML files too. Same approach as above, or in a separate XML file per page like:
<?xml version="1.0" encoding="utf-8"?>
<page>
<title>My test page</title>
<headline>Here is the header</headline>
<text>Here is some test text</text>
</page>
Problem with this approach though is that it starts to look A LOT like normal (X)HTML:
<?xml version="1.0" encoding="utf-8"?>
<html>
<head>
<title>My test page</title>
</head>
<body>
<h1>Here is the header</h1>
<p>Here is some test text</p>
</body>
</html>
What I am saying is: make sure your goal is right and you choose the right tool for the task. Customers aren't always right. Infact, they often come to us, because they have an idea, but dont know how to make it become real.
You be the expert!
To add to what BerggreenDK said above: Use flash to complement a DHTML website, say for adding banners, videos etc, but not to build one.
精彩评论