View Full Version : does flex support urls being opened in it
waelselo
12-12-2006, 09:11 PM
i know that flash doesn't support urls being opened in it, so any one know if flex has the same problem ...:confused:
meddlingwithfir
12-12-2006, 09:14 PM
You can make calls to URL's via Flex: http://livedocs.macromedia.com/flex/2/langref/index.html
But Flash by itself is will not render the HTML you get back.
medd
waelselo
12-12-2006, 09:18 PM
yes that what i want to say but the question is does flex render the html or is it just like flash ?
meddlingwithfir
12-12-2006, 09:31 PM
Flex, as far as I know it, does not have a built-in HTML renderer. Though I foresee them adding this -- another Adobe project (Apollo) is kind of hinging on the same technology -- the ability to use HTML as a layout tool for your desktop application:
From http://labs.adobe.com/wiki/index.php/Apollo:developerfaq#What_is_Apollo.3F
What technologies can I leverage within an Apollo Application?
Apollo will allow applications to be built using Flash / Flex and HTML / JavaScript or a combination of both.
Flash based applications will be able to include HTML based content, and HTML based applications will be able to use Flash based content.
In addition, Apollo applications will be able to integrate closely with PDF documents.
waelselo
12-12-2006, 09:39 PM
thank you ......
dr_zeus
12-12-2006, 09:40 PM
Adobe did not release any special HTML renderers as part of Flex. Any use of HTML is handled by the standard Flash TextField support.
meddlingwithfir
12-12-2006, 09:55 PM
And there actually is a little built-in support for HTML in the TextField class (although nowhere near enough to render most recent webpages).
http://livedocs.macromedia.com/flex/2/langref/flash/text/TextField.html
I believe you can create an iFrame in Flex though and display HTML in that?
meddlingwithfir
12-12-2006, 10:19 PM
Hmm -- I'm not seeing an iFrame class in the Flex 2 livedocs, nor am I seeing it in the acceptable HTML tags list. That'd be really cool if it did though -- I mean, you really could build a simple web browser very easily in Flex if it was as simple as creating a frame within Flex and using URLRequest to populate the source.
medd
dr_zeus
12-12-2006, 11:11 PM
IFrame's aren't directly supported in Flex, but people have found ways to communicate with them through ExternalInterface so that they appear to be part of the Flex application.
See: Finally Updated: Embedding HTML in a Flex application using an IFrame (http://www.deitte.com/archives/2006/08/finally_updated.htm)
CDHBookingEdge
12-13-2006, 02:44 PM
Has anyone snooped around the SDK source or such to see exactly "how much" HTML that a control like Label, can handle?
Christopher
Tag Description
Anchor tag - The <a> tag creates a hypertext link and supports the following attributes:
href—The URL can be either absolute or relative to the location of the SWF file that is loading the page. An example of an absolute reference to a URL is http://www.adobe.com; an example of a relative reference is /index.html. Absolute URLs must be prefixed with http://; otherwise, Flash treats them as relative URLs.
event—Use the event attribute to specify the text property of the link TextEvent that is dispatched when the user clicks the hypertext link. An example is event:myEvent; when the user clicks this hypertext link, the text field dispatches a link TextEvent with its text property set to "myEvent".
target—Specifies the name of the target window where you load the page. Options include _self, _blank, _parent, and _top. The _self option specifies the current frame in the current window, _blank specifies a new window, _parent specifies the parent of the current frame, and _top specifies the top-level frame in the current window.
You can use the link event to cause the link to execute an ActionScript function in a SWF file instead of opening a URL.
You can also define a:link, a:hover, and a:active styles for anchor tags by using style sheets.
Bold tag The <b> tag renders text as bold. A bold typeface must be available for the font used.
Break tag The <br> tag creates a line break in the text field. You must set the text field to be a multiline text field to use this tag.
Font tag The <font> tag specifies a font or list of fonts to display the text.The font tag supports the following attributes:
color—Only hexadecimal color (#FFFFFF) values are supported.
face—Specifies the name of the font to use. As shown in the following example, you can specify a list of comma-delimited font names, in which case Flash Player selects the first available font. If the specified font is not installed on the user's computer system or isn't embedded in the SWF file, Flash Player selects a substitute font.
size—Specifies the size of the font. You can use absolute pixel sizes, such as 16 or 18, or relative point sizes, such as +2 or -4.
Image tag The <img> tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and movie clips inside text fields. Text automatically flows around images you embed in text fields. To use this tag, you must set the text field to be multiline and to wrap text.
The <img> tag supports the following attributes:
src—Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG, GIF, PNG, and SWF files) do not show until they are downloaded completely.
width—The width of the image, SWF file, or movie clip being inserted, in pixels.
height—The height of the image, SWF file, or movie clip being inserted, in pixels.
align—Specifies the horizontal alignment of the embedded image within the text field. Valid values are left and right. The default value is left.
hspace—Specifies the amount of horizontal space that surrounds the image where no text appears. The default value is 8.
vspace—Specifies the amount of vertical space that surrounds the image where no text appears. The default value is 8.
id—Specifies the name for the movie clip instance (created by Flash Player) that contains the embedded image file, SWF file, or movie clip. This is useful if you want to control the embedded content with ActionScript.
checkPolicyFile—Specifies that Flash Player will check for a cross-domain policy file on the server associated with the image's domain. If a cross-domain policy file exists, SWF files in the domains listed in the file can access the data of the loaded image, for instance by calling the BitmapData.draw() method with this image as the source parameter. For more information, see the "Flash Player Security" chapter in Programming ActionScript 3.0.
Flash displays media embedded in a text field at full size. To specify the dimensions of the media you are embedding, use the <img> tag's height and width attributes.
In general, an image embedded in a text field appears on the line following the <img> tag. However, when the <img> tag is the first character in the text field, the image appears on the first line of the text field.
Italic tag The <i> tag displays the tagged text in italics. An italic typeface must be available for the font used.
List item tag The <li> tag places a bullet in front of the text that it encloses. Note: Because Flash Player does not recognize ordered and unordered list tags (<ol> and <ul>, they do not modify how your list is rendered. All lists are unordered and all list items use bullets.
Paragraph tag The <p> tag creates a new paragraph. You must set the text field to be a multiline text field to use this tag. The <p> tag supports the following attributes:
align—Specifies alignment of text within the paragraph; valid values are left, right, justify, and center.
class—Specifies a CSS style class defined by a flash.text.StyleSheet object.
Span tag The <span> tag is available only for use with CSS text styles. It supports the following attribute:
class—Specifies a CSS style class defined by a flash.text.StyleSheet object.
Text format tag
The <textformat> tag lets you use a subset of paragraph formatting properties of the TextFormat class within text fields, including line leading, indentation, margins, and tab stops. You can combine <textformat> tags with the built-in HTML tags.
The <textformat> tag has the following attributes:
blockindent—Specifies the block indentation in points; corresponds to TextFormat.blockIndent.
indent—Specifies the indentation from the left margin to the first character in the paragraph; corresponds to TextFormat.indent. Both positive and negative numbers are acceptable.
leading—Specifies the amount of leading (vertical space) between lines; corresponds to TextFormat.leading. Both positive and negative numbers are acceptable.
leftmargin—Specifies the left margin of the paragraph, in points; corresponds to TextFormat.leftMargin.
rightmargin—Specifies the right margin of the paragraph, in points; corresponds to TextFormat.rightMargin.
tabstops—Specifies custom tab stops as an array of non-negative integers; corresponds to TextFormat.tabStops.
Underline tag The <u> tag underlines the tagged text.
Flash Player supports the following HTML entities:
Entity Description
< < (less than)
> > (greater than)
& & (ampersand)
" " (double quotes)
' ' (apostrophe, single quote)
Flash also supports explicit character codes, such as & (ASCII ampersand) and € (Unicode € symbol).
CDHBookingEdge
12-13-2006, 05:10 PM
Thanks Tink, yeah it was my mistake I was getting TextField mixed up with mx:Text in my mind and then I saw in the SDK code it was derived from Label..so that's where I was (wrongly) going.
meddlingwithfir
12-13-2006, 09:26 PM
Wow, just by some random browsing on the web, I happened upon this blog post by an Adobe programmer that goes over the iFrame trick:
http://raghunathraoflexing.blogspot.com/2006/12/flex-i-frame.html
I haven't gone through the thing, but it seems like it could do what this person is looking for.
meddlingwithfir
12-13-2006, 09:30 PM
After looking through that post a bit further -- it looks like to use this technique, Javascript must be enabled in the browser. Not a huge deal for most people (if they've got Flash running, odds are they've got Javascript running too) -- still something to keep in mind though. It's not a only dependent on Flash.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.