Using AS3 I am dynamically creating, sizing, positioning and formatting a textfield. I am dynamically setting the content of the textfield from the contents of an xml file. I am trying to use the bold tag and noticed that it is not working. After a bit of searching the best I could come up with is "Flash CS4 tag in with htmlText". Bottom line: I have to embed an emboldened fontface.
As an example, let's say I want to use Tahoma. In my .fla file (using Flash CS4) I embed Tahoma and export it for use in actionscript. This lets me use Tahoma as a font in my textfield. If I try to use the b tag (textfield.htmlText="not bold, <b>bold</b>";) the bold text does not get emboldened. Based on the above question I have now embedded the Bold version of Tahoma as well.
How do I link the bold version of Tahoma with the regular version of Tahoma so that when using the bold tag I get bold text in my textfield?
I have 3 clips on my stage each containing a textfield into which I load 3 html files. I seem to have this part working fine, however the css I have loaded is not being applied to any text field. Not sure why. I am sure the fonts are embedded correct also. I have attached all the relevant files if needed. Ignore the scrollbars. They are the next challenge.
ActionScript Code: //load the style sheet var cssLoader:URLLoader = new URLLoader(); cssLoader.load(new URLRequest("files/mici.css")); cssLoader.addEventListener(Event.COMPLETE, cssLoaded); cssLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); [Code] .....
In the Flash CS4 IDE, if you have Dynamic Text, you can apply a filter labeled Adjust Color which lets you change Brightness, Contrast, Saturation, and Hue. Can someone explain how to do that through Actionscript 3 instead of the IDE? I found a couple of old tutorials and followed them but can't get things working. Not sure if that filter is called ColorMatirx or ColorMatrixFilter or if those refer to something else entirely.
I'm trying to apply a padding to the top of my TextField instance in my Flash application, much like you would using CSS.
I haven't found any way to do this. You'd expect it to be a part of the TextFormat or StyleSheet classes, but it's in neither. I sort of found a workaround by adding htmlText to the top of the TextField with <br /><br /> in it, but adding entire lines of white space to the top isn't desirable.
I'm trying to apply a format (specifically, green-colored text) to specific words in a TextField. I tried the below method, checking for words in an array "commands", and it works fine apart from a few issues below (see pic).
ActionScript Code: var commands:Array = ["green", "no"] // etc. function formatGreen(msg:TextField):void { for (var i in commands) {
Below is a code with my example. If you zoom in you'll notice that text is not as sharp as it is if you uncomment this line (txtFld.rotationZ = 90). Is there any way I can improve sharpness on font glyphs so after rotating they will look the same as before?
When applying text formatting to a comboBox, the text formatting appears perfectly on the dropdown menu items but the textField text disappears.Removing the text formatting from the textField makes the textField text reappear but of course there is no text formatting. Is there a trick to this.
on a project in Flash CS4 for Windows. I have an object on a layer that moves separately at different times of the animation (all one large motion tween). I'm attempting to apply an ease to just one leg of that motion, but instead, when I choose an ease setting in the motion editor, the ease is applied to the entire tween (so it affects the stationary frames too!). Is there a way to apply an ease to a single span of motion instead of the entire motion tween?Alternatively (if it's not possible), is there an easy workflow for breaking-up a motion tween in to separate motion tweens while maintaining the position of the object in between the motion tweens? (I don't want to use the frame-by-frame animation conversion option I've seen.)
I am using action script 3 and need to know how to apply more than 1 action to a frame label, ie; I have 5 pages of images and have actions coded as follows:
btn1.addEventListener(MouseEvent.CLICK,play1); function play1(event:MouseEvent):void{ gotoAndStop("1Lrg");
[Code]....
code continues like this for all the buttons (84 thumbnail images), so they will open a larger image when clicked. So what I now need to do is connect the side navigation buttons to go to the relevant page (frame) when clicked...the problem I'm having is that it is causing duplications in the code ie; I now have, for instance thumbnail (btn4) calling frame 4, but I also need a side navigation button to call this frame.
Ive searched and found this property .smoothing = true; But since im not using any bitmap vars i dont know where to put it, or maybe is it impossible to smooth images from my code and i need to rewrite it with bitmap stuff?
PHP Code: var myXML:XML = new XML(); var XML_URL:String = "newsXML.xml"; var myXMLURL:URLRequest = new URLRequest(XML_URL); var myLoader:URLLoader = new URLLoader(myXMLURL); myLoader.addEventListener("complete", xmlLoaded); [Code]....
I have a sprite called MaskSprite, and another sprite called PhotoSprite, with this relationship:
PhotoSprite.mask = MaskSprite;
Now MaskSprite contains a bunch of sprites as children...basically, what I have is a bunch of rectangles spaced apart, so that only strips of PhotoSprite are revealed. This works fine. But I want to blur each of these individual child sprites...but the revealed parts of PhotoSprite aren't blurred in any way. Isn't it as simple as:
Code:
for(var i = 0; i < 10; i++){ var s = new Sprite(); MaskSprite.addChild(s); s.graphics.drawRect(etc etc etc); s.filters = [new BlurFilter(10,10,1)];
Is there a way in AS3 to apply a class to an instance on the stage? Or is the only way to do it through the linkage menu in the library? The reason I ask is, I have a button class that I'd like to apply to only the button instances on the stage that meet certain criteria
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?
way to smooth my images via ac3. Ive searched and found this property .smoothing = true; But since im not using any bitmap vars i dont know where to put it, or maybe is it impossible to smooth images from my code and i need to rewrite it with bitmap stuff?
ActionScript Code: var myXML:XML = new XML(); var XML_URL:String = "newsXML.xml";
I'm importing XML text and sticking it in a text field. The text has some <span> tags with classes. Also importing a CSS file (verifying that it is importing correctly - at least when I trace it it says [object StyleSheet] - can I trace styles within a stylesheet? Or do an "exploded" trace that shows me everything in the stylesheet?)
Here's the key data:
AS (note default formatting, content, etc is working perfectly)
Applying tint to movieclip is just changing the color transformation of movieclip.
The easiest way is the Color class of fl.motion package.Just make the object of Color class, call setTint function and assign the object to movieClip.transfrom.colorTransform just find the attachment and do yourself. Cheers
visit this following link for more details and example [URL]...
I'm a very competent PHP/AS coder, but I can't seem to find a way to solve this problem. Can it be done? Possible ways I've theorised (but not been able to put into practice yet):
1) Loading AS script from external text file, much like loading CSS, or JS in HTML.
2) Writing AS to a movieclip as it is created on the fly.
I was just wondering whether or not it was possible to refer to all objects currently visible on the stage in Actionscript, be they images, text object, anything, to apply effects to.
Im using the following code from a tutorial to change the color of a movieclip called face, which works fine. But i cant figure out how to apply the following function to duplicate movieclips. I have been struggling with this for ages now.
for (i=0; i<5; i++){ var mcFace = face.duplicateMovieClip("newclip_face"+i,i); faceArray.unshift('newclip_face' + i);
I have a slider_mc which is currently being controlled by a mouse action
var value = 0; bar._x = value; bar.onPress = function(){
[Code]....
how can I apply a timer to automatically move the slider? eg a timer to count from 0 to 100 or alt replace the slider with a timer so that the image gradually changes from grey to color
I have an MC that I'm using TweenMax to manipulate filters on. I want to alpha the clip to 0 but have the outerglow remain, almost like a stroke, how this can be done, inside the mc is a PNG, so really I'm trying to create a dynamic stroke around the non - transparent portion of the PNG.
I'm having a strange issue with the Arial font in Flash CS4. I can create a text box and choose the Arial font. That appears to look like regular Arial text. However, if I want to choose a style (italic, bold, bold italic) the text does not change at all. These fonts are loaded on my system and always have been. They work in Flash CS3 and they work in all other programs including Illustrator and Photoshop CS4. In addition to that, all other fonts seem to work just fine including Arial Narrow and the other general system fonts. Arial Narrow allows me to select and apply all the available styles. It seems to be specific to Arial.
This also happens when I open a file that was originally created in CS3 or Flash 8. The font mapping notification does not appear, but if I had a text box that is supposed to be Arial Bold Italic, it automatically changes to look like regular Arial.
The addEventListener will be in a forloop and applied to all the circles that are created. But how do I have the function apply itself to all the circle(s). How do I send an "circle" array as an argument or whatever it's called to that clicked function.