Results 1 to 2 of 2

Thread: Flash Help! =[

  1. #1
    Junior Registered
    Join Date
    Mar 2007
    Posts
    9

    Angry Flash Help! =[

    hey,

    I've been working on this News Headline box for sometime now I'm using actionscript 2 on it, and i've got to a point where i need help.

    http://www.urbanreel.com/headlinesbox.swf <-- thats what i have so far.
    http://www.urbanreel.com/home <-- if your curious enough to see it in action.

    Basically, I want the 'Read More' button to be a link to the article/tutorial/whatever. But I can't get the button to work - I'm loading all the data via XML.

    Code:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
            <pic>
            <image>http://img1.urbanreel.com/flashslide/slideOne.jpg</image>
            <caption>How to ollie</caption>
    		<body>In the first ever tutorial on UrbanReel, Ash teaches you how to ollie on a skate board. So what you waiting for come check it out!</body>
    		<link>http://urbanreel.com/photos/all</link>
        </pic>
    	etc etc...
    </images>
    Now, I've got everything else working minus the button. I'll be honest i don't have the faintest idea how to add the button into my code.

    The AS Code:
    Code:
    function loadXML(loaded) 
    {
    if (loaded) 
    {
    xmlNode = this.firstChild;
    image = [];
    description = [];
    body = [];
    linkurl = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) 
    {
    
    image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
    description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
    body[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue; 
    linkurl[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue; 
    }
    firstImage();
    } else {
    content = "file not loaded!";
    }
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("images.xml");
    
    
    
    listen = new Object();
    listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
    prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
    nextImage();
    }
    };
    Key.addListener(listen);
    previous_btn.onRelease = function() {
    prevImage();
    };
    next_btn.onRelease = function() {
    nextImage();
    };
    
    
    
    
    p = 0;
    this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
    preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
    preloader._visible = false;
    if (picture._alpha<100) {
    picture._alpha += 10;
    }
    }
    };
    function nextImage() {
    if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    desc_txt.text = description[p];
    body_txt.text = body[p];
    picture_num();
    }
    }
    }
    function prevImage() {
    if (p>0) {
    p--;
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    desc_txt.text = description[p];
    body_txt.text = body[p];
    
    picture_num();
    }
    }
    function firstImage() {
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[0], 1);
    desc_txt.text = description[0];
    body_txt.text = body[0];
    
    picture_num();
    }
    }
    function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
    }

    So if anyone can offer a solution to my problem I will be very grateful!

  2. #2
    Registered Xander's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    263
    I think getURL might be what you need. From the button call that with the appropriate link. More info at http://www.devarticles.com/c/a/Flash...r-Designers/2/. Let me know if it works for you.

Similar Threads

  1. Tips on ranking high with flash!
    By twistedted in forum Search Engine Optimization
    Replies: 1
    Last Post: 08-24-2008, 10:58 PM
  2. Questions about Flash
    By Liz in forum Graphics & Multimedia
    Replies: 4
    Last Post: 07-07-2006, 06:57 AM
  3. New Flash TRAILER system
    By Emancipator in forum User Owned Websites
    Replies: 24
    Last Post: 02-07-2006, 07:55 AM
  4. Flash Games CMS System
    By Emancipator in forum Website Programming & Databases
    Replies: 5
    Last Post: 07-05-2005, 02:13 PM
  5. flash mx
    By eMEraLdwPn in forum Graphics & Multimedia
    Replies: 7
    Last Post: 12-26-2004, 01:27 PM

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
  •