Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Flash project (takeover) on rotating quotes

  1. #1
    Join Date
    Jun 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Flash project (takeover) on rotating quotes

    All,

    I have to modify somebody's project (rotate quotes on refresh see top right corner) to fit the new layout "From our customers" quotes instead of the rotating image files.

    It looks like there is a script on the page that is calling two other files; a flash movie quotes2.swg and an .xml file with the actual quotes.

    I've never done flash , your help would be greatly appreciated. I do have Adobe Flash CS3 if it helps.

    Here is that script:

    <script type="text/javascript">
    var so = new SWFObject("quotes2.swf", "quotes", "296", "199", "8");
    so.write("flashcontent");
    so.addParam("quality", "high");
    so.addParam("wmode", "transparent");
    so.addParam("salign", "t");
    so.write("flashcontent");
    </script>

  2. #2
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    Would you mind pasting your entire code down or even zipping up the project you are doing now. Because the code you posted it is javascript not Flash so it
    will be quite hard for people who wants to help you. I do not think javascript could be written in Adobe Flash CS3

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by avorob View Post
    All,

    I have to modify somebody's project (rotate quotes on refresh see top right corner) to fit the new layout "From our customers" quotes instead of the rotating image files.

    It looks like there is a script on the page that is calling two other files; a flash movie quotes2.swg and an .xml file with the actual quotes.

    I've never done flash , your help would be greatly appreciated. I do have Adobe Flash CS3 if it helps.

    Here is that script:

    <script type="text/javascript">
    var so = new SWFObject("quotes2.swf", "quotes", "296", "199", "8");
    so.write("flashcontent");
    so.addParam("quality", "high");
    so.addParam("wmode", "transparent");
    so.addParam("salign", "t");
    so.write("flashcontent");
    </script>
    Do you have access to the original .fla file for the implementation? If so, you should be able to open it in Flash CS3 and just alter the fonts/orientation. If you don't, then you'll have recreate it from scratch. The "script" you posted is just the code to embed the Flash into your HTML page. It has nothing to do with functionality.

    Now, if you just want to replicate the effects that you have on the new layout page, I'd suggest going with a javascript option. That might be easier for you to work with.

    But if you want to stick with Flash, you'll have to get your hands a little dirty in ActionScript. Below are some examples of how something like this is created. All of the files are released under Creative Commons NC, so feel free to play around with them.

    If you have any questions, post back.

    Here is XML-based random quote display created in ActionScript 2.0. It will show a new quote every time you refresh the page. Here is a version of the same movie that loops through the quotes and displays a new one very 10 seconds. I'll upload the source to the looping one a little bit later.

    For the AS 3.0 converts out there, here is a version of the same in ActionScript 3.0.

  4. #4
    Join Date
    Jun 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I've been digging through the tutorials on ActionScripts and some samples (starting with the one from Mr. Mediman) trying to dissect those for understanding. Unfortunately, the samples I found don't encompass all my task and I can't figure out how to modify or combine them. My task is to read the XML file (done), display one at a time quote (title/author) in a 300x100 window (need to figure out how to format that text), and randomly rotate the rotate quotes every time the browser is refreshed.

    Here my progress:
    - I adjusted my XML file with quotes to the following structure:
    <Books>
    <Book ISBN="1">
    <title>
    I just wanted to thank you so much for all your help in finding us a buyer for our home. We will always recommend your service to our friends, we could have some other possibilities for you with people that may want to move out of Westport in the near future. Thank you again for everything.
    </title>
    <author>
    The Malones - Westport, CT
    </author>
    </Book>
    <Book ISBN="2">
    <title>
    .....
    </Books>

    Here is the script that reads it:

    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();

    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

    xmlLoader.load(new URLRequest("books.xml"));

    function LoadXML(e:Event):void {
    xmlData = new XML(e.target.data);
    ParseBooks(xmlData);
    }

    function ParseBooks(bookInput:XML):void {
    trace("XML Output");
    trace("------------------------");

    trace(bookInput.Book.author.text()[2]);
    }

  5. #5
    Join Date
    Jun 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Quote rotator

    Right after I posted my comment I found a sample to rotate quotes
    http://blog.six4rty.ch/tutorials/fla...quote-rotator/

    Would it do what I need? I don't mind to redo the XML file headers.

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Yes, you can use that code. If you want to find out how to format the actual .fla file, download my AS3 example that I posted above.

    It's identical in functionality.

    What you would need to change in my example would the code related to reading the XML, since your XML is formatted differently. But that is only changing 1-2 lines of code.

  7. #7
    Join Date
    Jun 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    It works for me. Thanks so much. Actually, I like this script better as it shows a dynamic test not a movie. Thanks again.

  8. #8
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by avorob View Post
    It works for me. Thanks so much. Actually, I like this script better as it shows a dynamic test not a movie. Thanks again.
    Hmm...
    I think you're misunderstanding something. They both do the same thing in the same way (reading XML). But, by all means, if you understand one more over the other..use it.


  9. #9
    Join Date
    Jun 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Error

    I modified the code from http://www.visualbinary.net/files/tu...om-quotes/as3/ to removed lines 21-23
    // If there is no "title" for the author, move the quote up so there isn't a gap
    if(quote[index].attribute("title") == "") {
    theQuote.y = theQuote.y - 20;

    and lines 28-29
    // Set theTitle text field to the contents of the title attribute in the random node
    theAuthor.text = quote[index].attribute("author");

    As I don't have "title" in my quotes.xml file. It worked fine for me in the browser but apparentely kicking errors:

    TypeError: Error #2007: Parameter text must be non-null.
    at flash.text::TextField/set text()
    at randomQuotes_AS3AV_fla::MainTimeline/showRandomQuote()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

    What did I do wrong?

    Thanks.

  10. #10
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It looks like you deleted more than just those. Error 2007 means that you're probably trying to assign text to an object instead of a text field. Since, that isn't happening in the original code, you must have made some alterations.

    If you want to post the code on your actions layer here, I'm sure it'll be easy enough to spot the offending code.


  11. The Following User Says Thank You to Medyman For This Useful Post:

    avorob (07-15-2008)

Bookmarks

Posting Permissions

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