Ask a Question related to Macromedia Flash, Design and Development.
-
Nick #1
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
-
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... -
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... -
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'... -
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... -
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... -
Scott Rudy #2
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...canvas> Hi there,
>
> does any know how i can do a 'trim on canvas' sort of function. If mywrap> is bigger than my draw/animation etc, then how do i shrink my canvas to> 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
-
knut einar skjær #3
Re: trim function
Nick <ad@asd.com> wrote:
Menu (top) > Modify > Document > Hit "Content" ...> 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).
--
Knut Einar Skjær
[url]www.rsd.no[/url]
knut einar skjær Guest
-
seanald #4
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
-
Fernis #5
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.Even though the ">" is the last character we want to match, the regExp does> the match must end with a ">"
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
-



Reply With Quote

