Instead of doing it this way I want to define all the styles in a style sheet. I then want to define my slider in a .as file (not an mxml file) and apply the stylesheet to it. Something like the following is what I'm after
levelSlider= new VSlider()
levelSlider.minimum=0;
levelSlider.maximum=1;
levelSlider.value=1;
levelSlider.y=150
levelSlider.styleName="sliderStyle.css"
this.addChild(levelSlider)
var styles:String = ".keyword{color: #ff0000;} .comment{color: #00ff00;}"; var myStyleSheet:StyleSheet = new StyleSheet(); myStyleSheet.parseCSS(styles); myTextArea.htmlText = '<span class = "keyword"> red </span> uncolored <span class = "comment"> green text</span>';
Everything is fine till this point, i can edit my text, of course everything is showed in black, and the html-tags are ignored. But when I put this code in myTextArea.styleSheet = myStyleSheet; my text will be colored as i want it to be, but the textArea will become uneditable (no blinking pointer, no reaction on keyboard press).
After each keyboard-press (or if the time between two key-presses is bigger than x milliseconds ) i will re-render the textArea.text and append the <span class = "keyword"> where needed </span> tags and put it into the textArea.htmlText, but can't seem to figure it out how to do it when style is applied.
I have a dynamic text box that pulls HTML-formatted content from a PHP script and everything is working, including getting it formatted with a stylesheet, except the stylesheet seems to be ignored for <B> tags. This is the code I tried:
This is just for texting. I have a simple textbox with plain text, part of it in bold, part of it as a link, and the link gets the Baskerville font, but the bold tag doesn't. When I set a color for the link, the link gets a color but the bold tag doesn't.
Does MXML get compiled down to as3 and then converted to flash bytecode? Also, is there a significant performance penalty to compiling mxml vs compiling as3?
I am working on a custom Flex 4 component which is an aggregation of two existing flex components. I would like to be able to specify my own custom properties for the component as well as access the existing public subcomponent properties via MXML. For instance I might want to adjust the font color or style for the label and text input. toy component which aggregates both a label and a text input:
I am trying to override a Button class, i have a few properties which i wish directly initialise with the mxml description of the component, like :[code]which function is triggered ( in order to override it ) when all properties with mxml description is fully initialised with their values ?
What I'd like to do: create an MXML component with some children, then extend it via MXML to create a new component with more children, without losing the original set.In other words
create a component bc.mxml <?xml version="1.0" encoding="utf-8"?> <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
A Flex components values are initlized by init methord. In an application flow, How to refresh a mxml component data value ; as init is callled at the start up it self only.
eg. of mxml componet may be as simple as button label or text as complex as repeater whose data provider is a web service ( means a fresh quesy should be made to pull the data and refresh the dataprovider of repeater )
suppose i have 3 buttons(for example say, productin, marketing, sales ) on my main.mxml..once i click on one button it should take me to abc.mxml page with production data, once again if i click on second button it should take me to the same abc.mxml but with marketing data. same as for 3rd button also, how can i achieve this ?
I've been trying to create a custom mxml component that extends another custom mxml component (i.e.MyMXMLComponent -> BaseMXMLComponent -> Group). I've been reading that trying to add visual children to MyMXMLComponent caused error with Flex 3 but that's no longer the case with Flex 4.
What I want to know is whether this is a supported/fixed/documented feature of Flex 4? or just some undefined behavior in Flex 4 that may get changed with future updates?
if this is supported and documented feature, does anyone have link pointing to adobe document stating it as such?
This is a project I'm working on for a simple demo tutorial application in Flex. I am using mxml pages. You can see to the left that I will have my main application and then other mxml files (In the Examples Package) as the examples that will be loaded into the main application mxml. How can I dynamically pull the value from the object in the list to load the child mxml file into the container that I have further down in the application?
I imported two projects in Flex Builder 3 (A and B). Those two projects A and B are in the same folder and in mxml file which is located in A/src I have
<mx:Style source="../../B/b/assets/b.css" />
this relative path is correct, but Flex Builder keeps showing message: "Problem finding external stylesheet: ../../B/b/assets/b.css"
What am I doing wrong? Btw, I am newbie in flex, so,
I am loading css file in Flex 3 AIR application. While reading the style name, I am lowercase version of it (i.e, .NewFontStyle is converted to .newfontstyle)how to get name as mentioned in css file.[code]by this iam getting all styleNames in lower case only.. i need to get the name as mentioned in css file.
I would like to include an MXML file in my MXML file in the same way you can include an external file in AS3 using the include directive. Using the include directive brings the code from the external file into the original file at compile time placing it in the same scope. For example,
I have a problem in applying the styles for scroll bar skins through actionscript.[code]How can we specify scaleGrid properties in the above statement?
I want to be able to style or set properties dynamically.[code]I want to be able to set these properties in the skin so the skin can be styled differently for each component that uses it.
I have the following code to create and apply a few styles for a custom TextArea in ActionScript 3.
public class MyCustomTextArea extends TextArea { override protected function createChildren():void {
[code]....
I have two problems with this code.this.styleSheet is always null when I create an instance of the class. If this.styleSheet is initialized to new StyleSheet() to avoid this issue, then the TextArea instance does not seem to recognize any of the HTML tags that can be used with the htmlText property.
I am using to blur an image using BitmapData. The function is called on a Slider_changeHandler(event:Event):voidevent and the value of the slider is passed to the function as blurvalue.The problem is the function works but seems to be cummalative (if that's the correct word!), that is, suppose I slide it to the maximum and after that try to reduce the blur by sliding it back towards the front the blur still keeps increasing. How do I make it to work so when I will slide it up blur increases and when I slide it back blur decreases and when slider is at 0, no blur is applied.[code]
I'm using papervision3d and I am trying to wrap a single flv video around 4 sides of a cube (Excluding the toip and bottom) but I am unsuccessful so far. I have searched everywhere on the net and all I can manage is to display the single video on each side of the cube seperatly.
Code: video = new VideoStreamMaterial(videoFile, ncStream, true); var materialsList:MaterialsList = new MaterialsList() materialsList.addMaterial(video, "all");[code]....
Is there a way I can tell it to wrap the videoStreamMaterial around all 4 faces? Or if there isn't can I map the videoStreamMaterial onto a plane and then warp this plane to form a cube somehow?
We have a flex application which compiles fine on windows box using mxmlc ant task but when we try to run the same build scripts on linux, it throws the 'Invalid Embed directive in stylesheet' error indicating it is not able to resolve the path to the image files.
Can someone pls. educate me on if there is a difference in the way the image files are looked up, in a CSS file, on windows vs linux.
Flex sdk version is 3.3. The same sdk is used on both windows and linux. Not sure if this has been fixed by any future 3.x sdks.