;

PDA

Click to See Complete Forum and Search --> : Dynamic textfield masking with non-dynamic mask


Phix
03-29-2009, 04:47 PM
I've searched and searched and came up empty.

I'm creating a playlist for a music player, and I've got the song names displaying correctly in my songTitle holder MC, but there's limited space for the song names to be shown in, and I'm going to eventually have it inside a scrolling movieclip. Problem is, the text inside the textfields disappear when I try to add a mask to the movieclip they're being loaded into. I've tried adding all combos of embedFonts, antialias, and blendModes I ran into, to no avail. I even created a new AS3 file to make sure it's not something in my FLA.

I don't need an actionscript created mask, and don't understand where I'm going wrong. :(

So basically I'm asking how to mask dynamically created textfields with a non-dynamic (Flash IDE-made) mask.



for (var i:int = 1; i <= _size; i++) {
var pl_artist:TextField = new TextField;
//all embedFont = true and antiAlias commands no workie
}



Thanks all. :)

_Ric_
03-30-2009, 09:10 AM
Ive done this before and didnt have this problem. I didnt do anything special - just put the moving textfield into a movie clip, and masked the movieclip. Does the masking work properly if it's, say, just a shape rather than text? I assume you realise the mask shows whats beneath it (kind of counterintuitive - I'd expect it to hide whats underneath it hence the name mask!)

Phix
03-30-2009, 01:52 PM
You know, it must be something I'm doing. It doesn't feel right.

_Ric_
03-30-2009, 05:50 PM
I'm not sure why that doesn't work. The way I would do it though (and it does work) is to prepare the text field in the Flash IDE first. You can set the formatting as desired, add it to a holder sprite, then keep it in the library so you can create an instance from code when and where needed, and set the text dynamically. The only problem with masking text I ever had this way is if you apply filters to the text, they are not applied if the charachter count goes too high. (I forget the exact number but it's in the hepl docs somewhere).

v5000
03-30-2009, 07:25 PM
tField.cacheAsBitmap = true;

Also, if you want to use a movieClip as a mask then you will have set its cacheAsBitmap = true as well.

Phix
03-31-2009, 11:48 PM
@ _Ric_ : Yea it kinda got past me too. I'm just digging into the document class so I'll look into that when I'm comfy :)

@ v5000: I'll give it a go.

Phix
04-11-2009, 10:58 PM
So it seems we're back to this.

I solved the other one, at least for now. This time, there's an added step. On the same project I'm loading 2 different gallery swfs into the main movie depending on which link (pics/video) the user chooses. I've created an ImageLoader class that links easily with a moveclip of my choosing, an upon calling it it loads the image and displays the progress percentage.

Now, it would seem that flash doesn't display the text, and I can only guess it's an embedding problem. The text is there, it really is. I don't want to fudge the class and make it a progress bar instead, but I suppose it may come to that.

So the question:

Is it actually possible to get the text to show from a loaded swf under a mask?

Pseudo Hierarchy:

Main.swf has fonts embedded and in Library
-Masked MC (masked by shape, no MC or bitmap)
-Loading an external swf on same domain
-Loadee swf has fonts embedded and in Library


I still don't get why a simple task like this is so...sigh. Calm. Calm is good.

Thanks.

Phix
04-12-2009, 01:49 AM
Amazing. Abso*****lutely amazing.

There's a lotta people out there saying "oooh nooooo, this line is for Flex oooonllllyyyyy".

There's a lot I'd like to say to them. This line to the rescue in the AS file.


[Embed(source="C:\WINDOWS\Fonts\Standard0751", fontFamily="standard")]