dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Button Question (Quick one I hope)

  1. #1
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590

    Button Question (Quick one I hope)

    Hi Forum,

    Does anyone know if you should be able to use dynamic HTML as text on a button? I can't seem to get it to work at the moment.

    (I'd like to pull in data from an SQL server, then have that data appear on a button for selection)

    Thanks,

    Morgan.
    Please note that my domain has changed to http://www.morganmultinational.com

  2. #2
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590

    Answered my own question

    After trying for ages, I think the answer is no.

    Instead, it's possible to use an edit box in a layer positioned over the button, so that the button appears to be dynamic.

    It's a bit of an annoying work around, but it works.

    Morgan.
    Please note that my domain has changed to http://www.morganmultinational.com

  3. #3
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    No you can use an editbox inside of a button and fill it dynamically . Rui posted some code for this do a search for his posts and you should find it.

  4. #4
    Senior Member
    Join Date
    Nov 2003
    Location
    Coimbra - Portugal
    Posts
    139

    editbox inside of a button and fill it dynamically

    No you can use an editbox inside of a button and fill it dynamically . Rui posted some code for this do a search for his posts and you should find it.

    Is this?...

    http://www.sagos.pt/TESTES/anim_site/

    Or this?...

    http://www.sagos.pt/TESTES/presenter/

    In this cases work with an editbox inside of a button and text is puted dynamically, here came from xml file, but you can use any database.

    If yes let me know, i can supply you a movie file.

    Rui

  5. #5
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590
    Yep.

    This first one is pretty much what I'm after. Great. Ive done similar now, but I can't seem to change the editbox's variable when it's inside the button, so I've been putting it on top of the button.

    Have you an example of how I need to address the variable to get to it when it's inside the button? Perhaps the problem is because I've got the button under a layer.

    If you don't want to post the source on line, drop me a private message, and I'll give you my e-mail address.

    Thanks,

    Morgan
    Please note that my domain has changed to http://www.morganmultinational.com

  6. #6
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681

    Try this...

    Hello ForumNewbie,

    If you're trying to access the text box from within a script try
    root.variable="something";

    I tried this in the Starting Script and also in a script as an element.
    Cheers,
    kusco
    (3DFA Support Team)

  7. #7
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590

    Ahah. Now I understand !!!!

    Thanks for your help folks,

    Here is the result of my testing, after taking everyone's comments into account. Within 3DFA, if you want to address a variable inside a button:

    If the button has properties enabled, you have to use:
    PHP Code:
    element("Button Name").variablename="Does the element method work?" 
    If the button doesn't have properties enabled, you can still use:
    PHP Code:
    root.variablename="Does the root method work?" 
    These work fine in 3DFA

    HOWEVER:
    After exporting, only the root method works. Since the root method only works with buttons where properties are disabled, I conclude that I can't amend the variable showin in an editbox in a button with properties enabled.

    I've attached an example that makes it pretty clear I think. View in 3DFA, then export and try again in Explorer. Does anyone think there is a solution? I have another ugly workaround, but I'd prefer it if there was a nice solution.

    Rui: Did your buttons have properties enabled?

    Thanks for any help you can give,

    Morgan.
    Last edited by ForumNewbie; 01-19-2005 at 12:16 PM.
    Please note that my domain has changed to http://www.morganmultinational.com

  8. #8
    Senior Member
    Join Date
    Nov 2003
    Location
    Coimbra - Portugal
    Posts
    139

    your file

    Hi Morgan

    Please see attached file

    Rui
    Last edited by rui_eduardo; 09-29-2008 at 11:30 AM.

  9. #9
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590
    Perfect.

    Many thanks Rui.

    So it seems that I just needed to add '.movie' in the element method.

    PHP Code:
    element("Button Name")variablename="Does the element method work?"

    Becomes:

    element("Button Name").movie.variablename="Does the element method work?" 
    Thanks for your help. It just shows how great this forum is. Someone's always there to help

    M.
    Please note that my domain has changed to http://www.morganmultinational.com

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