3d Fonts, assets.swf

5 views
Skip to first unread message

Valts Darznieks

unread,
Aug 1, 2010, 11:28:42 AM8/1/10
to Away3D.dev
Hello I am trying to get 3d fonts to work, but I don`t understand how
to create assets.swf file.
Every example states that I should make new fla then new textField
then embed font in options, there is no embed font option in text
tool. Anyway could someone please explane about assets.swf ? Or is
there a way to embed font directly (I guess not if everyone uses this
assets.swf file) ?
Thank you for any help.

savagelook

unread,
Aug 1, 2010, 11:48:50 AM8/1/10
to Away3D.dev
Check out the demo (with source) I did on text in away3d:
http://savagelook.com/blog/away3d/the-many-forms-of-away3d-text

You can download the FLA and SWF files I used for the fonts there.
You can use the arial.swf as a font, or create your own with the FLA I
provided.

Valts Darznieks

unread,
Aug 1, 2010, 12:01:44 PM8/1/10
to Away3D.dev
Thank you this is perfect!
Should add this in away3d home demos or smth, a lot better then all
other examples of 3d text.

Valts Darznieks

unread,
Aug 1, 2010, 12:49:58 PM8/1/10
to Away3D.dev
Too bad fla is for cs5

savagelook

unread,
Aug 1, 2010, 2:11:10 PM8/1/10
to Away3D.dev
The FLA files available in other away3d text demos generally use
earlier versions, usually cs3. Check them out. In fact, i'm pretty
sure i used an FLA from an existing demo that was cs3 and just loaded
it in cs5.

Valts Darznieks

unread,
Aug 1, 2010, 5:31:14 PM8/1/10
to Away3D.dev
Not related to this topic, but..
How to enable mouse events on plane (not the material).
I have plane 300x20 and it has MovieMaterial with TextField, I need to
register hover on plane, not on MovieMaterial.
I hope you`l understand what I meant to explain here.

savagelook

unread,
Aug 1, 2010, 5:54:09 PM8/1/10
to Away3D.dev
plane.addEventListener(MouseEvent3D.MOUSE_OVER, yourMouseHandler);

Valts Darznieks

unread,
Aug 2, 2010, 4:19:27 AM8/2/10
to Away3D.dev
I understand how to addEventListener to plane, but it only will
register event when mouse is on MovieMaterial t.i on text I added to
movieclip, not on plane.
See text,text2 in example http://farm.dev.gameafrica.net/valts%20stuff/planeTest.swf

savagelook

unread,
Aug 2, 2010, 8:26:02 AM8/2/10
to Away3D.dev
I'm not sure I understand, can you post some code showing where you
create the text and plane, as well as how you apply the event
listener?

On Aug 2, 4:19 am, Valts Darznieks <vdarzni...@gmail.com> wrote:
> I understand how to addEventListener to plane, but it only will
> register event when mouse is on MovieMaterial t.i on text I added to
> movieclip, not on plane.
> See text,text2 in examplehttp://farm.dev.gameafrica.net/valts%20stuff/planeTest.swf

joebass

unread,
Aug 2, 2010, 8:38:17 AM8/2/10
to Away3D.dev
If you want the container of Text2 to handle the events, have you
tried setting mouseChildren = false?
> > > > > > > > > Thank you for any help.- Hide quoted text -
>
> - Show quoted text -

savagelook

unread,
Aug 2, 2010, 9:10:50 AM8/2/10
to Away3D.dev
I see... joe's right, and you might also have to set interactive=false
for the moviematerial.

ComplexCortex

unread,
Aug 2, 2010, 4:56:01 PM8/2/10
to Away3D.dev
Is there a way to get this to work if I'm not using Flex to develop?
The Embed parameter doesn't seem to work directly inside of an .fla

savagelook

unread,
Aug 2, 2010, 6:09:32 PM8/2/10
to Away3D.dev
Are you developing in flash pro? I've never used it for code (as the
editor sux). As a free alternative you might want to try
FlashDevelop, but really you should be able to use the font as long as
you have a way to load external files as byte arrays.

Valts Darznieks

unread,
Aug 19, 2010, 8:41:35 AM8/19/10
to Away3D.dev
Hi, sorry for late response, had other work on my hands.
Back to subject:
I added movieMat.interactive = false; but it still registers events on
material ( fonts ), I also added mouseEnabled = false etc.

http://farm.dev.gameafrica.net/valts%20stuff/planeTest.swf
public function generateMenuItem(_text:String):void {
planeElements++;
var mc:MovieClip = new MovieClip();
var textfield:TextField = new TextField();
textfield.text = _text;
textfield.setTextFormat(new TextFormat("Arial", 20, 0xFFFFFF));
textfield.autoSize = "left";
mc.mouseChildren = false;
textfield.mouseEnabled = false;
mc.addChild(textfield);

var textPlane:Plane = new Plane( { width:_text.length * 11, height:
20, yUp:false, ownCanvas:true } )
var movieMat:MovieMaterial = new MovieMaterial(mc);
movieMat.interactive = false;
textPlane.material = movieMat;
textPlane.x = initialX + (planeElements * 100); textPlane.y =
initialY;
this.addChild(textPlane);
initEvents(textPlane);

Michael Iv

unread,
Aug 24, 2010, 4:02:26 PM8/24/10
to away3...@googlegroups.com
Tony I don't get something ,may be you have an idea, in your example as well as in such other examples I found the extruded TextField3D is capped all right. But when I create it the same way  the extrusion is hollow ! .I can't get what is wrong here . I do it with Away 3.5 /

savagelook

unread,
Aug 24, 2010, 4:47:04 PM8/24/10
to Away3D.dev
I don't know how to cap it either, so I cheat. If you look at the
source for the demo (right click on it), you'll see I put a
textfield3d on both sides where the "cap" should be. Unfortunately
due to the nature of winding for vector shapes, one of those sides
will have the normals pointed in the wrong direction and I didn't find
a way to correct it. Let me know if you do though.

On Aug 24, 4:02 pm, Michael Iv <explomas...@gmail.com> wrote:
> Tony I don't get something ,may be you have an idea, in your example as well
> as in such other examples I found the extruded TextField3D is capped all
> right. But when I create it the same way  the extrusion is hollow ! .I can't
> get what is wrong here . I do it with Away 3.5 /
>
> On Tue, Aug 3, 2010 at 1:09 AM, savagelook <anthony.lukasav...@gmail.com>wrote:
>
> > Are you developing in flash pro?  I've never used it for code (as the
> > editor sux).  As a free alternative you might want to try
> > FlashDevelop, but really you should be able to use the font as long as
> > you have a way to load external files as byte arrays.
>
> > On Aug 2, 4:56 pm, ComplexCortex <complexcor...@gmail.com> wrote:
> > > Is there a way to get this to work if I'm not using Flex to develop?
> > > The Embed parameter doesn't seem to work directly inside of an .fla
>
> --
> Michael Ivanov ,Programmer
> Neurotech Solutions Ltd.
> Flex|Air |3D|Unity|www.neurotechresearch.comhttp://blog.alladvanced.nethttp://www.meetup.com/GO3D-Games-Opensource-3D/
> Tel:054-4962254
> explomas...@gmail.com
> t...@neurotech.co.il

Michael Iv

unread,
Aug 24, 2010, 4:50:53 PM8/24/10
to away3...@googlegroups.com
Thanks for your quick reply , Yeah now I can see your hack. The thing is that I took the Away book ("3d in Flash") and the example they show there on Text extrude shows the caps .So I just wondered may be I missed something .
Michael

savagelook

unread,
Aug 24, 2010, 5:25:24 PM8/24/10
to Away3D.dev
I believe I used that as a reference as well and was very confused by
the disparity between the picture in the book and the scene on my
monitor!

On Aug 24, 4:50 pm, Michael Iv <explomas...@gmail.com> wrote:
> Thanks for your quick reply , Yeah now I can see your hack. The thing is
> that I took the Away book ("3d in Flash") and the example they show there on
> Text extrude shows the caps .So I just wondered may be I missed something .
> Michael
>
> On Tue, Aug 24, 2010 at 11:47 PM, savagelook
> <anthony.lukasav...@gmail.com>wrote:
Reply all
Reply to author
Forward
0 new messages