Jump to content

Portfolio Project Display Using Flash/xml


Recommended Posts

Hey I am going be attempting to make a Flash picture viewer in order to display my architecture projects I've been making over the years. I attempted to code something basic before, but it became difficult in dealing with the multiple images and making them thumbnails and such. I have found tutorials before on using actionscript to call up the data in an XML file, but I dont really know the best way to make this file. I ended up downloading Liquid XML studio to help with the coding and I think I figured out how to make a schema for the xml file, though i'm not really sure what it is or what to do with it. I dont know much else about xml beyond whats below.

<xs:element name="Project_type">    <xs:complexType>      <xs:sequence>        <xs:element name="Project_Name">          <xs:complexType>            <xs:sequence>              <xs:element name="Type" type="xs:string" />              <xs:element maxOccurs="unbounded" name="Size" type="xs:string" />              <xs:element maxOccurs="unbounded" name="Features" type="xs:string" />              <xs:element name="Year_Designed" type="xs:string" />              <xs:element maxOccurs="unbounded" name="Program_Used" type="xs:string" />              <xs:element maxOccurs="unbounded" name="Skills_Learned" type="xs:string" />              <xs:element maxOccurs="unbounded" name="Work_Left" type="xs:string" />              <xs:element maxOccurs="unbounded" name="Picture">                <xs:complexType>                  <xs:sequence>                    <xs:element name="source" type="xs:anyURI" />                    <xs:element name="Title" type="xs:string" />                    <xs:element name="caption" type="xs:string" />                  </xs:sequence>                </xs:complexType>              </xs:element>            </xs:sequence>          </xs:complexType>        </xs:element>      </xs:sequence>    </xs:complexType>  </xs:element>

This created the basic XML sample for the coding

<?xml version="1.0" encoding="utf-8"?><!-- Created with Liquid XML Studio - 30 Day Trial Edition (http://www.liquid-technologies.com) --><Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\xampp\htdocs\jonsonlineportfolio\projects\xml\XSDFile1.xsd">	<Project_type>		<Project_Name>			<Type>string</Type>			<Size>string</Size>			<Features>string</Features>			<Year_Designed>string</Year_Designed>			<Program_Used>string</Program_Used>			<Skills_Learned>string</Skills_Learned			<Work_Left>string</Work_Left>			<Picture>				<source>image</source>				<Title>string</Title>				<caption>string</caption>			</Picture>			<Picture>				<source>image</source>				<Title>string</Title>				<caption>string</caption>			</Picture>		</Project_Name>	</Project_type></Project>

I believe this should handle the needed information once I figure out the action script side of things. But I have a few questions. But go to http://www.personal.psu.edu/jcc5018/House3.htm to see approx what I hope to accomplish. There are many projects within each project type, and then each project has the information above, but also includes multiple pictures that will have both a thumbnail and large version. One-- will this allow me to insert list in between tags such as the work left or skills learned? Or would I just have multiple tags of the same name for each item in the listTwo-- How do I best reference the pictures in the source tags.Three-- Where does the Project title/ Type information go if this is the current set up? Do i make it an attribute inside the first project_name tag? Project types would be: Residential, Hospitality, Commercial, ect, then under each type are the various projects. Four- It is a bit difficult I found in editing a file in this way. I could copy paste the basic format, but then I'd have to constantly delete things and reposition the cursor to fill in the needed information between tags. IS there a way to use a form or something to automatically enter the information in between the appropriate tags?Once I get this part set up I think I should be able to figure out a flash/ actionscript program to display it. Or at least I hope I can use the tutorials to make my own. My biggest issue though has been question 4 as it just seems very time intensive to do it this way and it seems very prone to mistakes. Thanks

Link to comment
Share on other sites

A schema is not needed here... not yet at least. So avoid it for now.It doesn't matter how you structure your XML. The only important part is how you can actually extract information from the XML file. This is done with ActionScript, which you've wrongfully chosen to avoid - you must not, as this is the only way Flash can extract data from XML. In particular, you need either XPath or DOM.So, to answer your questions as you've given them:1. Depends entirely on you, and how it will be comfortable for you. You can have an element representing such a list, and have child elements in it, or have just those elements directly, or make the contents be XHTML and use the XHTML <ul>, <ol> or whatever - again, it depends entirely on you.2. I'm not sure what you mean by that... the elements in your XML store the location of the XML. With ActionScript, you can take the appropriate location, and then make Flash fetch the picture at that location. This is similar to how the browser uses the <img/> element to find the appropriate picture.3. Wherever you want it to be. You may have a spcial element around your projects of that category, or have some new element within each project that will say what project type this is. Again - anything that goes in the markup is entirely up to you.4. Yes, but only on the server, with a server side language like PHP or ASP.NET for example. With them, you can open the file with DOM (the same DOM which is used by JavaScript and ActionScript), select the element(s) you want to edit, and alter them and/or add new elements/attributes/etc. (a.k.a. nodes) wherever you want them. Flash alone can't do it because it operates on the client. You can make changes with it, but you can't save them. After all, you don't want clients (read: hackers) to be able to delete stuff from your portfolio, right?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...