A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: How to set a contentpanel to a different file (Actionscriopt)

  1. #1
    Senior Member
    Join Date
    Aug 2006
    Posts
    109

    How to set a contentpane to a different file (Actionscriopt)

    Good morning ...

    I was wondering if anyone could give me an idea how to address the contentpane's File (property?).

    ie: I have a series of links ... click on each link and load the contentpane with a different text file (according to which link you pressed)

    I'm just a beginner but (in learning this arduous actionscript language) I can't figure out how to load a different file (every link would have it's own actionscpript to load it's own file into the content pane)
    like...

    on(press)
    {
    contentpane1.File = 'Song1Lyrics.txt';
    }

    Since it's not working I assume I'm not addressing it correctly... "File"

    I managed to load text into the contentpane by using the ".text" parameter. But, can't seem to load a file.

    Any help in how to load a text file (Via actionscript) would be appreciated.

    And any other obscure tip I may need to know ("oh you actually have to sync up this with this, and create a server before attempting to dynamically load files at runtime...") or whatever...

    amazing product by the way!!! (KoolMoves)
    Last edited by maed; 08-26-2006 at 09:10 AM.

  2. #2
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Try

    contentpane1.setContent(2,'Song1Lyrics.txt');

    For more information, check the file contentPane API.txt in directory
    C:\Program Files\KoolMoves\Examples\Components\Flash 8\API\

  3. #3
    Senior Member
    Join Date
    Aug 2006
    Posts
    109

    thanks.

    BOOM! That worked perfectly. Thanks!

    I appreciate the link as well.

    I just bought the software about 5 days ago and am pouring over documentation just to ATTEMPT to try to code something.

    Most of the documentation has been helpful, but it was high level.

    If anyone has any recommendations for more low-level documentation, please let me know.

    SPECIFICALLY syntax for actionscript.

    Something that says...

    here are the objects, components that Koolmoves has (contentpane, listbox, drop-down box, radio buttons)... and HERE is the list of each field (of each component) ... and this is how you address each field when trying to code actionscript.

    As in the example above...

    contentpane1.setContent(2,'Song1Lyrics.txt');

    Never would have occurred to me to use that syntax "setcontent".

    By the way... can you tell me what that parameter is ... the "2"

    I know in visual basic when working with files, you have to assign a number to each file...

    open "song.txt" as input #1

    or whatever...

    Is that what's it's doing?

    Thanks again.

    God, I love this software, and for only 50 bucks. Where have you been all my life.
    Last edited by maed; 08-26-2006 at 04:59 PM.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    good flash Actionscript docs are online
    http://livedocs.macromedia.com/flash...tml/wwhelp.htm

    The components are Koolmoves specific and for the syntax look in the exampe/components/flash8/ directory for the docs.

    And when all else fails Hollar here!

  5. #5
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by maed
    By the way... can you tell me what that parameter is ... the "2"
    It's explained in the file I mentioned.
    The first parameter states the content type. 2 stands for an external plain text file. Other values are for example for loading graphic content or assigning text directly. There's two additional parameters that are optional that let you specify a transition when you change the content of the contentpane.

    Wilbert

  6. #6
    Senior Member
    Join Date
    Aug 2006
    Posts
    109
    Yes, thanks I am checking out that file.
    Last edited by maed; 08-27-2006 at 06:25 AM.

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