EmbedFonts problem with AS2

Hey everyone,
I am having a problem using embedded fonts within my movie and no matter what i try I cannot get it to work. I  have a font embedded which is set to be exported for actionscript and  exported in the first frame. It has an identifier of myfontid. The  following code works fine and displays a text box using Arial:
Actionscript Code:
target.createTextField("newText",target.getNextHighestDepth(),50,50,100,300);
target.newText.text="hi there";
var myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
target.newText.setTextFormat(myTextFormat);
However the following doesn't work at all:
Actionscript Code:
target.createTextField("newText",target.getNextHighestDepth(),50,50,100,300);
target.newText.text="hi there";
var myTextFormat = new TextFormat();
myTextFormat.font = "myfontid";
target.newText.setTextFormat(myTextFormat);
target.newText.embedFonts=true;
I have been toying with this for ages now and read everything I can  about it  but am still having problems. It works when I use similar code  within an empty flv
file just not within my main movie. This is being run within an  onLoadComplete method for after the image that it sits on finishes  loading, i suspect there must be some issue with this but i can't see  what it is given it works without embedded fonts.
Thanks so much for your help on this, it's driving me crazy!!
Dave

This is driving me nuts When i copy the embed code across into a blank flv file (with the embedded font) and replace target with this then it works perfectly but it will not work no matter what i do within my main swf. The exact code i'm using is:
target.createTextField("newText",target.getNextHighestDepth(),50,50,100,300);
target.newText.text="hi there1";
var myTextFormat = new TextFormat();
myTextFormat.font = "fontid";
myTextFormat.color = "0xFFFFFF";
target.newText.setTextFormat(myTextFormat);
target.newText.embedFonts=true;
I just don't even know what to try anymore, i would think there's maybe a problem with running it all within an onloadcomplete statement or something like that however it works perfectly when i use standard non embedded fonts. Also when i debug the movie i can see the textfield newText and it has the correct variable and is has embedFonts set to true but still nothing shows up.
Any other suggestions would be massively appreciated as i really don't know what to try any more....
Thank you so much for your help,
Dave

Similar Messages

  • Problem with AS2 Enqueue utility

    Iam using the AS2 enqueue utility on 11.1.1.6.0 PS5 patch set.
    I am trying to simulate a message posted from a third party partner to my host partner.
    Below are the properties i used.
    user=Correct Username
    password=Pwd
    url=jdbc:oracle:thin:@host:port/SID
    ####### Payload Details #######
    replyToMsgID =
    from=ABC
    to=Host
    #eventName=SampleEvent
    doctypeName=ABC_ShipStatus_DocType
    doctypeRevision=1.0
    payload=/tmp/naveen/b2b/test.dat
    the issue is , in the reports section, the message i push through utility is coming but with incorrect partner values.
    i.e. My sender and reciever values are both coming as 'Host'.Hence my message is failing as it is not able to find the right TPA.
    Below is the snippet of my report
    Doctype TPA Sender Receiver
    ABC_ShipStatus_DocType Host Host
    But Iam expecting this
    Doctype TPA Sender Receiver
    ABC_ShipStatus_DocType ABC_ShipStatus ABC Host
    Also, Iam having the AS2 Signing in my realworld TPA. Will the simulation through Utility require any signing to complete the message?

    There is nothing like AS2 enqueue utility. What you are using is AQ (Advanced Queue) enqueue utility which is used to push outbound messages to B2B to simulate back-end -
    http://docs.oracle.com/cd/E23943_01/user.1111/e10229/enq_deq.htm#BGECCIBG
    You should set up another domain to mock the TP.
    Regards,
    Anuj

  • Downloading problem with AS2

    Hi all,
    I have an issue which has been driving me mad all morning. I'm trying to download a file from a remote server. I use the following code:
    import flash.net.FileReference;
    var listener:Object = new Object();
    var fileRef:FileReference = new FileReference();
    fileRef.addListener(listener);
    var url:String = "http://www.mysite.com/myFolder/myFile.jpg";
    if(!fileRef.download(url)) trace("dialog box failed to open.");
    If I execute this code, it works just fine. If I insert this code inside a sendAndLoad, it stops working. Here's an example:
    import flash.net.FileReference;
    c = new LoadVars();
    r = new LoadVars();
    r.onLoad = function(ok)
         var listener:Object = new Object();
         var fileRef:FileReference = new FileReference();
         fileRef.addListener(listener);
         var url:String = "http://www.mysite.com/myFolder/myFile.jpg";
         if(!fileRef.download(url)) trace("dialog box failed to open.");
    c.a = 1;
    c.sendAndLoad("http://www.mysite.com/myPhp.php", r, "POST");
    Does anyone have any idea as to why it doesn't work?
    Thank you!!!

    Hi, I'm back again.
    I've tried every possible combination, but I get the same results. Here's the code:
    import mx.controls.Alert;
    import flash.net.FileReference;
    System.security.allowDomain("www.mysite.com");
    // FIRST TRY  <------- GETS EXECUTED IF I RUN THE SWF, NOT IF I RUN THE HTML
    var listener:Object = new Object();
    listener.onSelect = function(file:FileReference):Void { trace("onSelect: " + file.name); }
    listener.onCancel = function(file:FileReference):Void { trace("onCancel"); }
    listener.onOpen = function(file:FileReference):Void { trace("onOpen: " + file.name); }
    listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void { trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal); }
    listener.onComplete = function(file:FileReference):Void { trace("onComplete: " + file.name); }
    listener.onIOError = function(file:FileReference):Void { trace("onIOError: " + file.name); }
    var downloadItem:FileReference = new FileReference();
    downloadItem.addListener(listener);
    if(!downloadItem.download("http://www.adobe.com/platform/whitepapers/platform_overview.pdf")) { trace("dialog box 1 failed to open."); }  
        c = new LoadVars();
        r = new XML();
        r.ignoreWhite = true;
        r.onLoad = function (ok)
            delete this.onLoad;
            var nodes = this.firstChild.childNodes;
           trace(nodes[1].firstChild.nodeValue);    <-------- GETS EXECUTED IF I RUN THE HTML, NOT IF I RUN THE SWF
    // SECOND TRY  <------ NEVER GETS EXECUTED
    var listener:Object = new Object();
    listener.onSelect = function(file:FileReference):Void { trace("onSelect:  " + file.name); }
    listener.onCancel = function(file:FileReference):Void {  trace("onCancel"); }
    listener.onOpen = function(file:FileReference):Void { trace("onOpen: " +  file.name); }
    listener.onProgress = function(file:FileReference, bytesLoaded:Number,  bytesTotal:Number):Void { trace("onProgress with bytesLoaded: " +  bytesLoaded + " bytesTotal: " + bytesTotal); }
    listener.onComplete = function(file:FileReference):Void {  trace("onComplete: " + file.name); }
    listener.onIOError = function(file:FileReference):Void {  trace("onIOError: " + file.name); }
    var downloadItem:FileReference = new FileReference();
    downloadItem.addListener(listener);
    if(!downloadItem.download("http://www.adobe.com/platform/whitepapers/platform_overview.pdf"))  { trace("dialog box 2 failed to open."); }
    c.a = 1;
    c.sendAndLoad("http://www.mysite.com/myphp.php", r, "POST");
    Here's the deal:
    1) I execute the SWF alone ---> the saveFile dialog appears. No trace messages appear. The 'download' that's getting executed is the one labeled FIRST TRY.
    2) I execute the HTML ---> No saveFile dialog appears, but I get 2 trace messages telling me that dialog boxes 1 and 2 have failed to open and I get the trace containing the value returned by the PHP
    I've tried this from two different computers, one at home, the other at the office and get the same results. What am I doing wrong??? I appreciate all your help.

  • Problem with CC Receiver with AS2 Adapter Seeburger

    Hi,
    I try to test the AS2 Adapter with Receiver channel y one server and Sender channel in second server, but in the Receiver channel, I have the error :
    "MP: Exception caught with cause com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of as2."
    I find the error and I found the URL Error in AS2 adapter. Object not found in lookup of as2.. Its urgent..!! with the same problem, but I have the same configuration in the Party of the receiver and the Sender, the same AS2ID name, and try with the solution in the forum respect the Party name in the scenario of the Receiver, but don't work.
    My scenario is send an IDOC from R/3 to a partner with the AS2 receiver channel.
    Is my fisrt scenario with AS2 adapter. Somebody help me please with any example or with any idea about the solution to my problem?
    Greetings,
    Hervey

    I have resolved this problem, thanks.

  • I tell her that I'm developing a flash content with as2 and I have a very simple problem, I hope you

    Hello, how are you?
    I tell her that I'm developing a flash content with as2 and I have a very simple problem, I hope you can help me
    I happened to create a movie clip and inside to create a scroll that is two isntancias,
    I mean:
    in the first frame create a button in the 6 to 5 buttons and an action to melleve the sixth frame and another to return. (Elemental truth)
    Now I have a problem. In creating a movie clip instance name to each button and in the average place the next fram as2,
    boton.onRollOver name = function () {
           gotoAndStop ("Scene 1", "eqtiqueta");
    because what I want is that from inside the movie clip, go to the scene proncipal to a frame that is three in the label name.
    however, does not work.
    appreciate your cooperation.
    Escuchar
    Leer fonéticamente
    Diccionario - Ver diccionario detallado

    Hello, I think you need to start a discussion on the Action Script forum. This is the Flash Player forum, the browser plugin.
    Thanks,
    eidnolb

  • Problem with preloader in Cs5 with AS2

    Hey,
    I made a preloader in Cs5 with AS2 code:
    mask_mc._height = 1;
    this.onEnterFrame = function():Void
    var loading :Number = this.getBytesLoaded();
    var total :Number = this.getBytesTotal();
    var precent:Number = Math.round(loading/total*100);
    mask_mc._yscale = precent;
    txt.text = precent + "%";
    if (loading >= total)
    gotoAndStop(2);
    because I realized that what I'm used to in Cs4 is not working in Cs5. It works fine but, when I press a button that supose to go to another frame, it stock on frame 2.
    How can I solve it?

    terminate that loop:
    mask_mc._height = 1;
    this.onEnterFrame = function():Void
    var loading :Number = this.getBytesLoaded();
    var total :Number = this.getBytesTotal();
    var precent:Number = Math.round(loading/total*100);
    mask_mc._yscale = precent;
    txt.text = precent + "%";
    if (loading >= total)
    delete this.onEnterFrame
    gotoAndStop(2);

  • Problem with TextField formatting

    I'm having a little bit of a problem with this very basic bit
    of code. The following code works fine: (I apologize for not having
    it in a format that may be more suitable)
    this.createTextField("my_text", this.getNextHighestDepth(),
    10, 70, 400, 100);
    my_text.text = "This is my TextField.";
    //my_text.embedFonts = true;
    However, for some reason, this doesn't work. I'm baffled by
    why uncommenting this simple line of code makes it not show up:
    this.createTextField("my_text", this.getNextHighestDepth(),
    10, 70, 400, 100);
    my_text.text = "This is my TextField.";
    my_text.embedFonts = true;
    Any help would be appreciated.

    My guess is that you forgot a few things to work with
    embedded fonts...
    1) Have you embedded the font you want to use inside your
    library and given it a unique id.
    2) If you did #1, try this...

  • Problem with append += text in Text Field

    Hi guys
    i have a problem with append text.
    I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc];
    Then i have one String and one Text Field.
    Using for loop im getting right results. But when im running script again then im getting  same text again.
    F.ex.
    First time:
    City name: Name 1
    City name: Name 2
    Second time:
    City name: Name 1
    City name: Name 2
    City name: Name 1
    City name: Name 2
    I have tried to make TextField to and String to Null and delete it, but it's appearing again.. :/
    How to avoid this?
    Here is script:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    _CityAreaTF1 = new TextField();
      _CityAreaTF1.border = true;
      _CityAreaTF1.wordWrap = true;
      _CityAreaTF1.multiline = true;
      _CityAreaTF1.selectable = false;
      _CityAreaTF1.antiAliasType = AntiAliasType.ADVANCED;
      _CityAreaTF1.name = "CityAreaTF1";
      _CityAreaTF1.embedFonts = true;
      _CityAreaTF1.htmlText = _CityAreaString1.toUpperCase();

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Problem with non-stop looping

    This file has been supposedly changed from As2 to As3. It seems as if it used to stop when I first got it. But the links didn't work. When I followed troubleshooting protocols, it started looping non-stop.
    Please help. I can't seem to attach the flv and the action script files. All I get from the output window is "Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts."
    Please help. I paid a coder to switch the file from as2 to as3 and this is what he gave me...

    contact that coder and let them know the problem.  if it's a problem with their code, they should fix it without charge.

  • Problem with action script 3 make input text box and button....

    Hi every one I am trying to make a family book using "Air for Android" with a simple search engin in the book
    air for android only work with AS3,
    the search function is to type a person's name and hit submit then go to a specific frame.
    have a problem making below code to work in AS3 and hopefully one of you guys can lead me in the right direction to fix the issue.
    Currently, I have an input text box and a button. When you type specific words into the input box and then hit the button it sends you to a specific frame.
    (it work find in AS2 but not in AS3,)
    Here is my current code that is placed on the main timeline, first frame:
    stop();
    onEnterFrame = function () {
        submit.onRelease = function() {
            switch (yourname.text) {
            case "name1" :
                gotoAndStop(2);
                break;
            case "name2" :
                gotoAndStop(3);
                break;
    My button that checks if the phrase is correct is called "submit" and my input box has an instance of "yourname".
    My phrases that will be accepted in the input box are "name1" and "name2" which bring me to two different frames.
    Basically, I'm having a problem with making this to work with AS3.

    you should use the default option in the switch statement
    that way yourname contains something not in one of the case statements it will go to the default bit and execute teh code there
    function onSubmit(e:MouseEvent):void
                                  switch (yourname.text)
                                            case "name1":
                                                      gotoAndStop(2);
                                                      break;
                                            case "name2":
                                                      gotoAndStop(3);
                                                      break;
                                            default:
                                                      goToAndStop(you frame you want);
                                            break;

  • Image Gallery, problems with Flash player 9 and Opera 9

    Hi, I'm developing a slideshow in flash (and php, JavaScript,
    XML).
    I'm coding in classes and AS2.
    I use the ExternalInterface class to communicate between
    swf's and html.
    The problem is that the Slideshow won't work properly in the
    Opera browser,
    it seems like it's working fine, but after a few click it
    stop responding.
    No problems in IE and FF.
    I've search and search to find a solution to this problem
    with no luck.
    I've put up an example of the slideshow here:
    http://www.coldminer.com/up/sw.php?thumbs=1
    The strange thing is that when I use really simplified
    versions of the code
    I'm using (with no externalInterface etc) it is working fine:
    http://www.coldminer.com/ftest/
    Anyone who have experienced similar problems, and can guide
    me to a solution.
    Opera version: 9.02 (8585)
    Flash player version: 9,0,16,0
    Thank you!
    ** Edit ->
    I found a solution, I replaced th ExternalInterface with the
    "Flash JavaScript Integration Kit",
    and all my problems with Opera was solved.

    Lo stesso problema ce l'ho io. Sembra che flash player 9 non
    riesca a leggere le versioni flash 5. Nell'installare un corso
    contenente flash 5 ho questo errore:
    Prodotto: Corso Multimediale per Photoshop 7 -- Errore 1904.
    Impossibile registrare il modulo C:\WINDOWS\system32\swflash.ocx.
    HRESULT -2147319780. Contattare il personale di supporto.

  • Problems with simple picture gallery

    I've got a website project where the client wanted a picture
    gallery. I don't really do much with Flash so I went on the web and
    found a tutorial on how to get what I want. Problem is that the
    instructions I followed are fairly old so I couldn't export my
    movie any higher than AS2 and Flash 6 and have it work. That would
    be fine except that I wanted to use a feature that requires Flash 8
    or higher, namely a gradient mask. I was hoping that I could post
    my code and have the board gurus help me out with what i need to do
    to get everything working together.
    First you'll want to create a movie using AS2 and Flash 8 to
    see what I'm trying to accomplish, then export it again with Flash
    6 to see it actually working. You can grab a copy of what I'm
    working with here:
    http://www.technospider.com/~david/rusty.zip
    All help greatly appreciated.
    Thanks,
    David

    based on experience. i didn't check your file.
    you're not likely to get anyone in this forum to check your
    file.
    if there's not code problem, and you can't publish for flash
    8, there will be an error message. if you can publish for flash 8,
    you see no error message but your application fails to work
    correctly, you must have a problem with code.

  • Problem with embed font such us some character

    Hi  i have some problems with a font.
    I have this simple code.
    [CODE]
    package {
    import flash.text.AntiAliasType;
    import flash.text.TextFormat;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextField;
    import flash.text.Font;
    import flash.display.Sprite;
    [SWF(backgroundColor="#FFFFFF", frameRate="31", width="700", height="500")]
    public class ExampleEmbedFontKoz extends Sprite {
    private var mytextfield : TextField;
    private var format : TextFormat;
    public function ExampleEmbedFontKoz() {
    Font.registerFont(AssetManager.kozgopro);
    createText();
    private function createText() : void {
    mytextfield= new TextField();
    addChild(mytextfield);
    mytextfield.embedFonts= true;
    mytextfield.width= 400;
    mytextfield.border= true;
    mytextfield.autoSize= TextFieldAutoSize.LEFT;
    mytextfield.antiAliasType= AntiAliasType.ADVANCED;
    format= new TextFormat();
    format.font="KozGoPro-Regular";
    mytextfield.defaultTextFormat= format;
    mytextfield.text= "try embed KozgoPro and write puntualitation.\n i can't view this letters: è é ò à ù ì";
    [/CODE]
    AssetManager
    [CODE]
    package {
    public class AssetManager {
    [Embed(source="KozGoPro-Regular.otf", fontName="KozGoPro-Regular",mimeType="application/x-font", fontWeight="normal", fontStyle="normal" , unicodeRange="U+0021-U+007B,U+0400-U+04CE,U+2000-U+206F,U+20A0-U+20CF,U+2100-U+2183,U+002 0-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+00 7E")]
    public static  var kozgopro : Class;
    [/CODE]
    when i write character such us è ò à ì don't view nothing.
    I put file online... [url]http://depositfiles.com/en/rmv/6620791594111859[/url]

    Thank i added this range and now works...
    U+00E9,U+00E0,U+00EC,U+00ED,U+00F2,U+00F3,U+00DA,U+00FA,U+00F9
    this range are lettere è ò à +ù ì

  • Some strange problem with Flash/As3

    Hi,
    I am having some strange problem with my flash cs3.
    Whatever script I write in as3  doesn't work, even a stop() function doesn't work . But when I change my publish setting to as2 it works fine.
    Not sure about the root cause, may be some setting or preference or my cs3 is corrupted.
    Can anybody please advise.
    Thanks,
    Kishor

    try this
    create a new fla as3,
    select frame 1
    open the actions panel
    paste in the following code
    var squares:Array = new Array;
    setup();
    function setup():void {
        for (var i = 0; i < 25; i++) {
            var square:Sprite = new Sprite();
            //square.name = "square" + i;
            square.graphics.beginFill(Math.random() * 0xffffff);
            squares.push(square);
            squares[i].graphics.drawRect(0, 0, 100, 100);
            squares[i].x = i*3;
            squares[i].y = i*3;
            squares[i].filters = [];
            square.graphics.endFill();
            stage.addChild(squares[i]);
    for (var j = 0; j < squares.length; j++) {
        squares[j].addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
        squares[j].addEventListener(MouseEvent.MOUSE_UP, dropMovie);
        squares[j].buttonMode = true;
    function dragMovie(event:MouseEvent):void {
        event.target.startDrag();
    function dropMovie(event:MouseEvent):void {
        event.target.stopDrag();

  • Problems With Publishing a file from a Mac

    Hi everyone, i'm developing a website with a designer. I'm doing the  coding part, while he is doing the design. We are using Flash CS3 with  AS2.
    I made a common preloader for the website and sent to him where he  applied the design to the program. Problem is, i'm using windows vista  home premium, while he is using Mac.
    I developed the preloader and sent to him, it worked like a charm on the  mac, but then he sent the file back to me and i can't publish the fla.
    It seems that everytime i hit ctrl+enter he doesn´t do anything. Worst  than that, if i have the swf in the same directory as the fla, when try  to publish it, it deletes de swf file...
    I really need help on thins, does anyone have an idea about what's  happening ?
    Thanks in advance, Cláudio

    Do you get an error? Look in the Publish Settings window. In the first pane, check the paths for the .swf and the .html files.

Maybe you are looking for