Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default trim function

    Hi there,

    does any know how i can do a 'trim on canvas' sort of function. If my canvas
    is bigger than my draw/animation etc, then how do i shrink my canvas to wrap
    around my object? (there's a Trim in PS but i can't seem to find this or a
    crop function in Flash mx 2004).

    - thanks for any comments.


    Nick Guest

  2. Similar Questions and Discussions

    1. problem with the trim() function
      I am working on a german website and I have a username called "zartbitters??". When I use the #trim(username)# it removes the german letter ?. The...
    2. Trim problem
      Hi, i have another complex problem i cannot figure out. I have a string called #file_name#. The string's value is a filepath and file name of a...
    3. Need to Trim value in a List
      I have a list that retrieves documents in a directory. <!--- Pack Directory ---> <cfdirectory action='list' directory='C:\TNS_Docs\EXCEL_PACKS'...
    4. trim string
      How do i cut the last 4 characters in a string? I know how to cut the 4 first, but i need to cut the last! I have a image name like testimage.gif...
    5. note 33646 added to function.trim
      Regarding the editor's note to rhelic above about how to trim all elements in an array: I wanted a perl "chomp" of newlines for all elements in an...
  3. #2

    Default Re: trim function

    Click on your largest object such as the background clip and find the width
    and height in the properties window. Click on the stage that is showing or
    click Modify/Document/Settings, click on size and enter the width and height
    you found in the properties of your background clip, this will resize the
    stage to fit the background.

    Flash MX 2004 doesn't have a crop or trim.
    "Nick" <ad@asd.com> wrote in message
    news:417237cc$1_1@news.iprimus.com.au...
    > Hi there,
    >
    > does any know how i can do a 'trim on canvas' sort of function. If my
    canvas
    > is bigger than my draw/animation etc, then how do i shrink my canvas to
    wrap
    > around my object? (there's a Trim in PS but i can't seem to find this or a
    > crop function in Flash mx 2004).
    >
    > - thanks for any comments.
    >
    >

    Scott Rudy Guest

  4. #3

    Default Re: trim function

    Nick <ad@asd.com> wrote:
    > Hi there,
    >
    > does any know how i can do a 'trim on canvas' sort of function. If my canvas
    > is bigger than my draw/animation etc, then how do i shrink my canvas to wrap
    > around my object? (there's a Trim in PS but i can't seem to find this or a
    > crop function in Flash mx 2004).
    Menu (top) > Modify > Document > Hit "Content" ...

    --
    Knut Einar Skjær
    [url]www.rsd.no[/url]
    knut einar skjær Guest

  5. #4

    Default Trim function

    I am trying to trim unessasary data from a webpage. The code I have found does
    work, but I am trying to better udnerstand how it works, and if there is a
    better way to do it. If anyone could help that would be great. Here is the
    code...

    I am especially looking for an explanation of what "<[^>]*>" does in the trim
    function.????

    <CFHTTP METHOD="Get"

    URL="http://nikonimaging.com/global/products/digitalcamera/slr/d2x/index.htm"
    RESOLVEURL="Yes">
    </CFHTTP>




    <CFSET temp_page=#CFHTTP.FileContent#>
    <cfset temp_page = trim(rereplace(replacenocase(cfhttp.filecontent, "border=0
    alt=""><br>", ""), "<[^>]*>", "", "all"))>


    <cfset location1 = #find("DX Format with 12.4 effective
    megapixels",temp_page)#>

    <cfoutput>#location1#</cfoutput>


    <cfif location1 EQUAL 0>
    <cfset ck=1>
    <cfelse>
    <cfset location2 = #find("data for the same shot",temp_page)#>

    <br><cfoutput>#location2#</cfoutput><br>

    <!--- <cfset
    strip="http://www.sonystyle.com/is-bin/INTERSHOP.enfinity/eCS/Store/en/-/USD/SY_
    DisplayProductInformation-Start?CategoryName=hid_cameras_ServicePlans_Camera s&Pr
    oductSKU=DSCT7&TabName=specs&var2=##Mid(temp_page, location1, location2 -
    location1)"> ----->
    </cfif>



    <cfset ron = "#Mid(temp_page, location1, location2 - location1)#">
    <!--- <cfset ronlist = #rereplace(ron, "&##0149;","<BR><li>","all")#>
    <cfset ronlist = #rereplace(ronlist, "<BR>","<ul><BR>")#>
    <cfset ronlist = "#ronlist#</ul>">--->
    <cif ck EQ "0">
    <cfoutput>
    #ron#
    </cfoutput>Text

    seanald Guest

  6. #5

    Default Re: Trim function

    Now, I'm not a regExp guru actually, so I might go wrong, but here's my
    translation:

    The "<[^>]*>" will match any <TAG> that contains at least something between
    the <>.

    Step by step (, ooh, baby!) :

    < start matching by finding a "<"
    [^>] match a character, which is NOT ">"
    * extends the previous condition so that 0 to zillion occurences of
    anything but ">" is ok.
    > the match must end with a ">"
    Even though the ">" is the last character we want to match, the regExp does
    not know that until we've found something else first. The processing goes from
    left to right. That's why the formula in many regExps often goes as:

    1. Find the starting character(s)
    2. Find anything BUT the ending character(s)
    3. Find the ending character(s)

    The "<[^>]*>" will thus match "<>" and "<table border='0'>". If there's a
    string "<ta>ble>" it'll only match the "<ta>". Nothing will be done to the
    "ble>".

    To me, your current code makes sense, if you're referring to tags as
    "unnecessary data".

    Fernis Guest

  7. #6

    Default Re: Trim function

    thanks for your help.
    seanald Guest

Posting Permissions

  • You may not post new threads
  • You may 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