Professional Web Applications Themes

External Text files into a director file/projector - Macromedia Director Basics

Hi, I am making a cdrom with is multi lingual, the text of the cdrom will be external text files (*.txt) what I am aiming to have is a button whcih would load/unload the different text file, uultimately, i should be able to edit the text files within notepad and not within director! does anyone know how I could have exteral text files linking into my director file? ur help would be much appreciated!...

  1. #1

    Default External Text files into a director file/projector

    Hi, I am making a cdrom with is multi lingual, the text of the cdrom will be external text files (*.txt)
    what I am aiming to have is a button whcih would load/unload the different text file, uultimately, i should be able to edit the text files within notepad and not within director!

    does anyone know how I could have exteral text files linking into my director file?

    ur help would be much appreciated!


    sanjG webforumsuser@macromedia.com Guest

  2. #2

    Default Re: External Text files into a director file/projector

    Hi,

    I presume that what you are asking is how do you dynamically import text files into Director. If this is the case you will need to do the following:

    1) Import one of the text files into a cast member slot and make sure Media is set to Link to External File in the Import Files dialog box.
    2) Now you can dynamically import text files with the following code (probably attached to your button):

    member("member name of your linked text file").fileName = <the location of the new text file to import>

    For example:

    member("myTextFile").fileName = the moviePath & "newTextFile.txt"

    However, you will need to reset the properties of the text object as it will reset to the default settings of an imported text object (scrollbars etc.).

    Remember also that text files have no styling attached to them. If you want to maintain any styling of the text (bold etc.) it is recommended that you use RTF (Rich Text Format) files instead.

    Hope this helps
    Stephen White
    Craftmedia




    Saxon webforumsuser@macromedia.com Guest

  3. #3

    Default Re: External Text files into a director file/projector

    Hiya mate! thats exactly what i was thinking off...

    another one for u.....

    im making a business card maker program in director (for a uni project) , the user has a choice of four templates which they can edit - ie, colour, text etc etc, but i need to have a function where the user can save their card design then open it up at a later stage.

    any idea how i could do this? i would need to design it so i can store thier card, note that this dir demo has to run as a projector..let me know if you have any ideas...


    sanj


    sanjG webforumsuser@macromedia.com Guest

  4. #4

    Default Re: External Text files into a director file/projector

    Hi,

    I think for this you will need to store the individual settings in a property list. For example:

    cardData = [#template: 1, #colour: 255, #text: "My business card", #logo: "myLogo01.bmp"]

    You would then change the settings in this list depending on the user's selection. So if they changed their template to template 3 (a green card with a logo top-left, for example) you would change the template property in the list as below:

    cardData[#template] = 3

    Text you could pull directly from a text member they edit on the stage:

    cardData[#text] = member("textBox").text

    You could use an Xtra such as the free FileXtra to allow the user to load in the logo for their business card via a file requester. You could then import the image into a linked bitmap cast member. You would only need to store the path and filename of the logo image in your cardData property list.

    Basically, you are holding the 'description' elements of each template in a property list.

    You could create a property list for each template and the user's card:

    template1 = [#template: 1, #colour: 255, #text: "My business card", #logo: "myLogo01.bmp"]
    template2 = [#template: 2, #colour: 45, #text: "Welcome", #logo: "myLogo02.bmp"]
    template3 = [#template: 3, #colour: 112, #text: "Our company is great", #logo: "myLogo03.bmp"]
    userCard = [#template: 1, #colour: 255, #text: "My business card", #logo: "myLogo01.bmp"]

    So, we have defined individual template settings (for when creating a new card based on a template) and a userCard property list to store the user's custom settings.

    The user could then choose to save their business settings so they can load them at a later date and edit them. You would need to save the contents of the property list as a text file (there are some very good INI file write and read Xtras as well). This means that the user loads their business card text file which is then read in by your program and the settings stored within are applied to the graphical elements on the stage that make up the business card.

    Hope this helps.

    Cheers
    Steve White
    CraftMedia


    Saxon webforumsuser@macromedia.com Guest

Similar Threads

  1. Integrate external XML files in my Flash projector EXE
    By kn!ght in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: January 4th, 09:27 AM
  2. Director Projector files, Cross platform?
    By Coldstone webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: December 13th, 11:49 AM
  3. Download files from Director Projector
    By jessicaa webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: September 29th, 03:10 PM
  4. linking to external files that will play outside of the projector
    By pucketti@bellsouth.net in forum Macromedia Director Basics
    Replies: 0
    Last Post: September 23rd, 08:08 PM
  5. Director Trial version - projector files
    By dadico webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 4
    Last Post: June 30th, 07:26 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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139