A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [RESOLVED] making a resume in flash with data file

  1. #1
    Member
    Join Date
    May 2001
    Posts
    43

    [RESOLVED] making a resume in flash with data file

    this is my current cv, painstakenly written in flash:

    http://disfasia.net/cv/cvenglish.html

    I was told that I can use an external data file and load this into a flash file with xml, i am trying to make an xml file that will do what you see here above. But i cannot get the information to load properly where each title is separate (bold) and the description underneath it (plain text)...please help me out. i cannot get my cv to show up in a linear format as it only shows the first entry and then stops.

    here is the file http://www.disfasia.net/test.zip


    all help appreciated greatly!

    cheers


    disfasia

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Just a suggestion. I would use a single html enabled textfield and concatenate (join) all the items as one into this field. This way you can decide the layout of each item as it is pushed into the field inside the loop in the xml load (see script example). Using different variations and line returns I'm sure you can get it to a visual display layout that is pleasing to you.

    XML structure I used:


    ?xml version="1.0"?>
    <cv>
    <entry>
    <name>Assistant Professor University de Montreal (2003-Present)</name>
    <comment>Teach comparative literature and cinema studies</comment>
    </entry>
    <entry>
    <name>Doug Engelbart</name>
    <comment>Invented the mouse at the Stanford Research Institute</comment>
    </entry>
    </cv>


    Actionscript:

    function loadXML(loaded) {
    if (loaded) {

    var items=xmlData.firstChild.childNodes;
    for(var i=0; i<items.length;i++){
    _root.cv.htmlText += "<b><font size='12'>"+items[i].childNodes[0].firstChild.nodeValue+"</font></b>\n";
    _root.cv.htmlText += items[i].childNodes[1].firstChild.nodeValue+"\n\n";

    }
    } else {
    trace("file not loaded!");
    }
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("test.xml");


    Result:

    http://www.flex-fanatic.com/examples...mlpartial.html


    Experimentation is the key

  3. #3
    Member
    Join Date
    May 2001
    Posts
    43
    thanks chris.

    but now i am bit out of my knowledge. what does this mean "html enabled textfield"...where do i put it? in flash? and i assume the coded for the actionscript goes on the first empty frame of my fla. so what do i do with the textfield (again, i am assuming you mean one single textbox, multiligne..)..?
    thanks

    disfasia

  4. #4

  5. #5
    Member
    Join Date
    May 2001
    Posts
    43
    i did this actually...i figured the text box was in flash,...and no type shows up. even in the fla you sent me, the xml file (entitled "test.xml") does not load. and i have the code from above pasted directly in the document.

    what might i have done wrong?

    thanks

    disfasia

  6. #6
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Check the font settings in the properties panel for the textfield. You may have to use embedded fonts or etc depending on the font you are using. Play around with it...it works....that running example at my site is that exact movie

    The mouse is pointing to the setting I am using in this pic...yours may differ:

  7. #7
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Also...you should get into the habit of utilizing the trace. I could pop a trace command before the last bracket in the loop to track what is pushed to the textfield even if the frontend display isn't displaying it (due to whatever reason...font problem..etc) like so

    trace("file not loaded!");
    }
    trace(_root.cv.text);
    }// trace setup before last bracket in the loop


    It also helps you in many other ways...like to make sure the XML object is being handled...all kinds of things. Trace is GOD

  8. #8
    Member
    Join Date
    May 2001
    Posts
    43
    i don't know how but i got the type to show up. but using the font tool in flash only changes the font in bold print (the first line of each entry) and not the second line. how do i control the second line?

    thanks again

  9. #9
    Member
    Join Date
    May 2001
    Posts
    43
    i don't know how but i got the type to show up. but using the font tool in flash only changes the font in bold print (the first line of each entry) and not the second line. how do i control the second line?

    thanks again

  10. #10
    Member
    Join Date
    May 2001
    Posts
    43
    by the way, how do i get accents to show up (ie. é, Ã*, etc.)

    best

  11. #11
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I'm telling the first line to be bold with standard html tags.

    _root.cv.htmlText += "<b><font size='12'>"+items[i].childNodes[0].firstChild.nodeValue+"</font></b>\n";
    _root.cv.htmlText += items[i].childNodes[1].firstChild.nodeValue+"\n\n";


    Again...using html tags Flash supports....you will have to construct the display with tags you prefer and in whatever way you decide. Mine was an example of one line (xml node) with and one line (xml node) without the "bold" attribute applied.

    http://livedocs.adobe.com/flash/mx20...=00001040.html

  12. #12
    Member
    Join Date
    May 2001
    Posts
    43
    Thanks again Chris. I did this. Now, my next step is this:

    I have a base flash file--the one with the buttons, title, etc. that I want to remain the same. And most importantly, the button that would scroll this new file into this web site:

    http://disfasia.net/cv/cvenglish.html

    how would i get the text of my cv to scroll INTO my base website. The tricky part is this: as you can see on the top of my cv is my name and contact info with a white border. how can i make this new flash file go not on top of (the words would be projected twice then) but INTO the site? what do you suggest?

    best

  13. #13
    Member
    Join Date
    May 2001
    Posts
    43
    ps. and how to make the arrow in the base flash file control the scrolling text file. Remember I will have to make eight separate files, so the arrow cannot control only one file, but any one of eight (education.swf, experience.swf, and so on).

  14. #14
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Well, to be honest, this is less of an XML question than it is a general use or design question and out of the scope of this forum. The best I could do is suggest perusing the movie section here where there are literally thousands of movies that you could possibly learn to do anything you want in Flash. Search for terms like "scrolling textfield" and similar. Same with google. You will find both tutorials and examples in that realm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center