Close

Results 1 to 3 of 3

Thread: Flash help

  1. #1
    DF VIP Member hxbro's Avatar
    Join Date
    Nov 2000
    Location
    Behind a wall
    Posts
    2,731
    Thanks
    4
    Thanked:        18
    Karma Level
    476

    Default Flash help

    I've never written flash before but I'm trying to work through something and I'm stuck, it's either possible or not possible.

    I want to create buttons on the fly, which are created from an xml file on the server (actually a php script which generates the xml).

    The following code is running, but I need to put the button onto the scene which is where I'm stumped.

    Code:
    // create the buttons in the panel
    for (loop = 0; loop < ids.length; loop++)
    {
    	buttons[loop] = new Button();
    	buttons[loop]._x = loop * (170 + 10);
    	buttons[loop]._y = 0;
    	buttons[loop]._name = "DSymbol " + loop;
    	buttons[loop]._url = "screenshots.php?id=" + ids[loop];
    	panel.addButton(buttons[loop]);
    }
    Does the code look like it should work, panel is the scene as far as I can tell - is there anything else I might need to do.

    Another way I thought was is it possible to copy a button in the script, so if I defined a default button then replicated it for each new button, then set the _x value which would be the same thing as far as I can tell.

    Any ideas, I can't create the buttons before hand and just set them as I need them as it's unknown how many screenshots I'll have
    Download my latest breaks and electro mixes or listen to Sellout Breaks FM

  2. #2
    DF VIP Member hxbro's Avatar
    Join Date
    Nov 2000
    Location
    Behind a wall
    Posts
    2,731
    Thanks
    4
    Thanked:        18
    Karma Level
    476

    Default Re: Flash help

    ignoring the bit above (I've still not fully sorted it but getting there), the code was never called as the xml file wasn't loading properly which populated the ids array, I missed off xml.ignoreWhite = true which meant the ids array was never populated.

    I've found the trace command now which helps debug this sort of thing.
    Download my latest breaks and electro mixes or listen to Sellout Breaks FM

  3. #3
    DF VIP Member ParkerDigital's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    455
    Thanks
    0
    Thanked:        0
    Karma Level
    239

    Default Re: Flash help

    only just come across this post. So did the whitespace thing fix it? Yes, the trace command is invaluable for debugging things like this.

Similar Threads

  1. Funny flash cartoons
    By ZX7R in forum The Dog and Duck
    Replies: 2
    Last Post: 31st January 2014, 08:37 AM
  2. Cheapest website for Flash 2 Linker?
    By pfrench69 in forum Old Skool Gaming & Retro
    Replies: 6
    Last Post: 26th November 2002, 01:48 AM
  3. Wicked Flash File
    By Pegasus in forum The Dog and Duck
    Replies: 11
    Last Post: 13th November 2002, 11:46 PM
  4. T100 To T108 Flash File
    By BAZZO69 in forum Unlocking Questions & Solutions
    Replies: 7
    Last Post: 4th September 2002, 07:53 PM
  5. New flash card and programmer
    By lemaru in forum Old Skool Gaming & Retro
    Replies: 1
    Last Post: 30th August 2002, 09:41 AM

Social Networking 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
  •