TextFormat size being rounded to int

Hello

can anyone confirm if it should be possible to define a size property cases TextFormat to a floating-point number? I'm trying to put a 12.5, but the instance Textfomat rounds the number, when it is set, back to 12.

The as3 docs specify that the size of the TextFormat property is an object and the State that represents the value 'the size in pixels of the text in this text format '. This means that it must be a whole pixel? There is no explicit mention of the fact that it would be an int or that it cannot be a floating point number?

I ran a test separated in flash professional cs3 IDE and I am able to create a dynamic Textfield on the stage and its size the value floating point number. Seems odd that it works, but you're not able to accomplish the same thing progrmmatically?

I found an old post on the flex forum suggesting that incorporating the fonts 'perhaps' solve this problem, but my fonts are already integrated, so it doesn't seem to be one.

Thank you

James

You are right. dynamic font size is rounded to the nearest int.

Tags: Adobe Animate

Similar Questions

  • Pixels being rounded down?

    So I'm trying to copy an accurate measurement of one element to another, but Illustrator is rounded to decimal cloest bridge measures. For example, I want my icon to sit on 66.21 px but there it rounds up to 66 px. In the middle is the icon I amtrying to align. I want the 4 red squares to sit in the same medium as the sqaure track surrounding it. The surrounding sqaure developed because I use it to various sizes and hang in there to be consistent.

    Screen shot 2013-08-09 at 2.12.09 PM.png

    You have created a web profile document? Can you check if "Snap to grid of pixels" is enabled for the object of the transformation Panel? Also check if the option 'Align new objects to the pixel grid' is enabled? If so turn it off.

    I hope this helps!

  • Need help with images of different sizes being loaded from a container of centering

    Stop();

    mainArea_mc.visible = false;

    home_btn.addEventListener (MouseEvent.CLICK, function () {Stop ("model home")});

    var totalImages:int = 0;

    var imageDirectory: String = "";

    var currentImage:int = 1;

    var filePrefix: String = "";

    var loader1: Loader = new Loader(); 2 Chargers, so we can fade a picture on top of the other

    var loader2: Loader = new Loader();

    pic_mc. AddChild (loader1);

    pic_mc. AddChild (loader2);

    loader1. Name = "loader1."

    loader2. Name = "loader2";

    loader1.contentLoaderInfo.addEventListener (Event.COMPLETE, resizeFadeImage);

    loader2.contentLoaderInfo.addEventListener (Event.COMPLETE, resizeFadeImage);

    info_mc.title_txt. AutoSize = TextFieldAutoSize.LEFT;

    If (presModeSlides) / / slides Viewer vars configuration

    {

    totalImages = slides [currentSlideNumber] .numSlides

    imageDirectory = "Data/slides/"+slides[currentSlideNumber].directory+"/";

    filePrefix = "slide";

    info_mc.title_txt. Text = .title slides [currentSlideNumber]

    info_mc.speaker_txt. Text = .speaker slides [currentSlideNumber]

    info_mc.university_txt. Text = .university of slides [currentSlideNumber]

    }

    else / / Setup Photo viewer vars

    {

    totalImages = 233;

    imageDirectory = "data/images /";

    filePrefix = "image";

    info_mc.title_txt. Text = "user International BioPlex® 2200 3 meeting;

    info_mc.speaker_txt. Text = "Images";

    info_mc.university_txt. Text = "";

    }

    info_mc.speaker_txt.y += info_mc.title_txt.height;  Position sublines so that they are directly under the title

    info_mc.university_txt.y += info_mc.title_txt.height;

    leftArrow_btn.addEventListener (MouseEvent.CLICK, prevImage);

    rightArrow_btn.addEventListener (MouseEvent.CLICK, nextImage);

    showImage (currentImage)

    function showImage(num:int)

    {

    If (pic_mc.getChildIndex (loader1) > pic_mc.getChildIndex (loader2)) / / set the jpg file in what container is on top for the moment

    {

    loader1. Load (new URLRequest (imageDirectory + filePrefix + currentImage + '.jpg'));

    }

    on the other

    {

    loader2. Load (new URLRequest (imageDirectory + filePrefix + currentImage + '.jpg'));

    }

    }

    function resizeFadeImage(e:Event)

    {

    e.currentTarget.loader.alpha = 0;

    Tweener.addTween (e.currentTarget.loader, {alpha: 1, time: 0.4, onComplete: removeOtherImage, onCompleteParams:[e.currentTarget.loader]});})

    e.currentTarget.loader.scaleX = 0.75;

    e.currentTarget.loader.scaleY = 0.75;

    var bitMap: Bitmap = Bitmap (e.currentTarget.loader.content);

    bitMap.smoothing = true;

    }

    function removeOtherImage(l:Loader)

    {

    If (l.name is "loader1")

    {

    pic_mc. SetChildIndex(loader1,0);

    If (loader2.content! = null)

    {

    If (loader2.content is Bitmap)

    {

    (loader2.content as Bitmap).bitmapData.dispose ();

    }

    }

    }

    on the other

    {

    pic_mc. SetChildIndex(loader2,0);

    If (loader1.content! = null)

    {

    If (loader1.content is Bitmap)

    {

    (loader1.content as Bitmap).bitmapData.dispose ();

    }

    }

    }

    }

    function nextImage(e:Event)

    {

    If ((!)) Tweener.isTweening (loader1)) & & (!) Tweener.isTweening (loader2)))

    {

    If (currentImage < totalImages)

    {

    currentImage ++;

    }

    on the other

    {

    currentImage = 1;

    }

    showImage (currentImage);

    }

    }

    function prevImage(e:Event)

    {

    If ((!)) Tweener.isTweening (loader1)) & & (!) Tweener.isTweening (loader2)))

    {

    If (currentImage > 1)

    {

    -currentImage;

    }

    on the other

    {

    currentImage = totalImages;

    }

    showImage (currentImage);

    }

    }

    :

    function resizeFadeImage(e:Event)

    {

    e.currentTarget.loader.alpha = 0;

    Tweener.addTween (e.currentTarget.loader, {alpha: 1, time: 0.4, onComplete: removeOtherImage, onCompleteParams:[e.currentTarget.loader]});})

    e.currentTarget.loader.scaleX = 0.75;

    e.currentTarget.loader.scaleY = 0.75;

    e.currentTarget.loader.x = (stage.stageWidth-e.currentTarget.loader.width)/2;

    e.currentTarget.loader.y = (stage.stageHeight-e.currentTarget.loader.height)/2;

    var bitMap: Bitmap = Bitmap (e.currentTarget.loader.content);

    bitMap.smoothing = true;

    }

  • Rounded corners do not work in Firefox 13.0

    When trying to style css with "moz" CSS corner it displays properly in Firefox 13.0 it shown as a box rounded, instead of being rounded.

    I tested it in firefox 12 and all night. I got perfect results. It shows the rounded corners. could you send your code and check it please that you code once. It works very well without add - moz - also.

  • used tablspace size in MB

    HII everyone,
    I have script to check tablespace usage and it works fine but the problem is just used space shows in '%' I want that space used in "MB".can someone help me, how to get a space in MB? the script and its output is shown below, your help is very appreciated.

    Thank you.

    SQL >
    SQL > select tablespace_name,
    2 round (sum (allocated_space) / 1024 / 1024, 2) "size (MB)",.
    round (sum (free_space) 3 / 1024 / 1024, 2) 'free (MB).
    round ((sum (free_space) /sum (allocated_space)) 4 * 100, 2) "% free"
    5 round (((sum (allocated_space) - sum (free_space)) /sum (allocated_space)) * 100, 2) '% used (s) '.
    6 (select tablespace_name, allocated_space bytes, free_space 0)
    7 of dba_data_files
    8 union of all the
    9. Select nom_tablespace, 0 allocated_space, free_space bytes
    dba_free_space 10)
    11 group by tablespace_name
    12 order by 4
    13
    SQL > /.

    Size (MB) (MB) fr. Nom_tablespace % free used
    ------------------------------ ---------- ---------- ---------- ----------
    SYSTEM OF 700 1.81 99,74.26
    SYSAUX 700 40,25 5.75 94.25
    USERS 7.5 1.5 20 80
    EXAMPLE 100 21,56 21,56 78,44
    UNDOTBS1 75 51,63 68,83 31.17



    Published by: 938946 on January 14, 2013 12:39 AM

    Published by: 938946 on January 14, 2013 12:40 AM

    Add this column:

    Round(( SUM(allocated_space) - SUM(free_space) ) / 1024 / 1024, 2)
    

    See...

    SELECT tablespace_name,
           Round(SUM(allocated_space) / 1024 / 1024, 2)
           "Size (MB)",
           Round(SUM(free_space) / 1024 / 1024, 2)
           "Free (MB)",
           Round(( SUM(free_space) / SUM(allocated_space) ) * 100, 2)
           "% Free",
           Round(( ( SUM(allocated_space) - SUM(free_space) ) / SUM(allocated_space)
                 ) *
                 100, 2)
           "%Used",
           Round(( SUM(allocated_space) - SUM(free_space) ) / 1024 / 1024, 2)
           "Used (MB)"
    FROM   (SELECT tablespace_name,
                   bytes allocated_space,
                   0     free_space
            FROM   dba_data_files
            UNION ALL
            SELECT tablespace_name,
                   0     allocated_space,
                   bytes free_space
            FROM   dba_free_space)
    GROUP  BY tablespace_name
    ORDER  BY 4;  
    
  • not accepting letterSpacing is not decimal values

    Im trying to give a format of specific text to my textFields. The problem here is that when I put the letterSpacing property with a decimal value, I get a result rounded space... 1.4 becomes returns 1 to 1.5 spacing px 2. It is very fustrating.

    Adobe documentation:

    "A number that represents the amount of space that is distributed evenly between all the characters.       The value specifies the number of pixels that are added in advance after each character.       The default value is null , which means that 0 pixels of letter spacing is used.      You can use decimal values such as 1.75 . »

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/text/TextFormat.h tml? filter_flash = cs5 & filter_flashplayer = 10.2 & filter_air = 2.6 #letterSpacing

    Copy the following code will show you my problem, you will have noticed the absence of values all about letterSpacing values inbetween.

    Paste inside the .fla file
    var stringtest:String = "Hello World";
    var numJump:Number = 20;
    var spacingVal:Number = 0;
    var index: Number = 0.2;

    var textFormat:TextFormat = new TextFormat();
    textFormat.font = "Arial";
    textFormat.size = 12;
    textFormat.letterSpacing = spacingVal;

    for (var i: int = 0; i < 25; i ++) {}
    var testText:TextField = new TextField();
    textFormat.letterSpacing = spacingVal;
    testText.defaultTextFormat = textFormat
    testText.width = stage.stageWidth;
    testText.text = stringtest +""+ textFormat.letterSpacing;
    testText.y = testText.textHeight * i;
    stage.addChild (testText);

    spacingVal += increment;
    spacingVal = (Math.round(spacingVal*10)) / 10;
    }

    Thanks in advance.

    you need to incorporate your policy is to use fractional letterspacing.  Add font Arial to your library and assign the class = ArialF.  You can then use:

    import flash.text.Font;

    var stringtest:String = "Hello World";
    var numJump:Number = 20;
    var spacingVal:Number = 0;
    var index: Number = 0.2;

    var textFormat:TextFormat = new TextFormat();
    var tf: do = new ArialF();
    textFormat.font = tf.fontName;
    textFormat.size = 12;
    textFormat.letterSpacing = spacingVal;

    for (var i: int = 0; i<25; i++)="">
    var testText:TextField = new TextField();
    textFormat.letterSpacing = spacingVal;
    testText.defaultTextFormat = textFormat;
    testText.width = stage.stageWidth;
    testText.embedFonts = true;
    testText.text = stringtest +""+ textFormat.letterSpacing;
    testText.y = testText.textHeight * i;
    stage.addChild (testText);

    spacingVal += increment;
    spacingVal = (Math.round(spacingVal*10)) / 10;
    }

  • Picture editor; How to follow the touch

    Hello

    first of all, I chose to develop a BlackBerry 10 app for my Masters project and needed a little help. I hope you guys can help.

    Requirement:

    I shud be able to paint on a picture to select the area. so being able to blur the portion of the image. for example, the background and the blur out.

    can someone help me please how I can achieve this?

    Thank you

    Copy the following code:

            screen_context_t screen_ctx;
        screen_pixmap_t screen_pix;
        screen_buffer_t screen_buf;
        int size[2] = { 768, 1280 };
        int val;
        char *pointer = NULL;
        int stride;
        /* Create the privileged context so that the display properties can be accessed. */
        screen_create_context(&screen_ctx, SCREEN_APPLICATION_CONTEXT);
        /* Create pixmap for the screen shot. */
        screen_create_pixmap(&screen_pix, screen_ctx);
        /* Set usage flag. */
        val = SCREEN_USAGE_READ | SCREEN_USAGE_NATIVE;
        screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_USAGE, &val);
        /* Set format. */
        val = SCREEN_FORMAT_RGBA8888;
        screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_FORMAT, &val);
        /* Set the pixmap buffer size. */
        screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_BUFFER_SIZE, size);
        /* Create the pixmap buffer and get a handle to the buffer. */
        screen_create_pixmap_buffer(screen_pix);
        screen_get_pixmap_property_pv(screen_pix, SCREEN_PROPERTY_RENDER_BUFFERS,
                                                    (void **)&screen_buf);
        /* Get the pointer to the buffer. */
        screen_get_buffer_property_pv(screen_buf, SCREEN_PROPERTY_POINTER, (void**)&pointer);
        /* Get the stride. */
        screen_get_buffer_property_iv(screen_buf, SCREEN_PROPERTY_STRIDE, &stride);
            angleF = 0.0;
            bps_initialize();
            if (sensor_is_supported(SENSOR_TYPE_GRAVITY))
        {
            sensor_request_events(SENSOR_TYPE_GRAVITY);
        }
        int nbytes;
        Window *winId = Application::instance()->mainWindow();
        /* Take the display screen shot. */
        screen_read_window(winId->handle(), screen_buf, 0, NULL ,0);
    

    creates a buffer of your screen. You can get touch places of activities of the mobile finger (the number of pixels), add them to a list or whatever, then obtain a general rgb for the region value as follows:

    screen_get_buffer_property_pv(screen_buf, SCREEN_PROPERTY_POINTER, (void **) &ptr);
    
                    for (int i = 0; i < size[1]; i++, ptr += stride) {
                            for (int j = 0; j < size[0]; j++) {
                                // do your pixel reading here: r = ptr[j*4], g=ptr[j*4+1], b=ptr[j*4+2], alpha = ptr[j*4+3]
                                }
                            }
                    }
    

    Note that the code above is for an entire screen, so you will have to change accordingly. Once you have a general RGB value, divide by the total number of pixels that you went through to get a certain RGB (or choose another method that might be simpler). Restart the loop to repaitn pixels of same with the same color. BAM! you will have a uniform colour where you pressed.

  • uniform extensions in 11.2.0.3

    Oracle: 11.2.0.3

    Segment tablespace: Self management, 8 sizes of block k, 250 k extended size on ASM.

    All my extensions have a minimum size of 8 MB with no data at home. Is this a minimum size that oracle is based on the size of the adjustment block? It is not mission-critical. Its just something I'm trying to understand.

    I expect to be 250 k.

    Note that the name of tablespace has been changed just for purposes of accounting

    [code]

    create tablespace mytablespace datafile '+ DATA '.

    size                                 1g;

    management measure SIZE UNIFORM local 250K;

    [/ code]

    Guess2 wrote:

    Oracle: 11.2.0.3

    Segment tablespace: Self management, 8 sizes of block k, 250 k extended size on ASM.

    All my extensions have a minimum size of 8 MB with no data at home. Is this a minimum size that oracle is based on the size of the adjustment block? It is not mission-critical. Its just something I'm trying to understand.

    I expect to be 250 k.

    Note that the name of tablespace has been changed just for purposes of accounting

    create tablespace mytablespace datafile '+ DATA '.

    size                                 1g;

    management measure SIZE UNIFORM local 250K;

    And how to check that the uniform size becomes 8 M?

    Are you running on Exadata? It is possible that the size of the measure is being rounded to match the size of the AU that uses ASM.

    250KB is a little weird,-, it is not even a multiple of the size of your block.

    Concerning

    Jonathan Lewis

    http://jonathanlewis.WordPress.com

    Now on Twitter: @jloracle

  • daafiles used and free space

    HII everyone,
    I want to check the space used and free of all my (10.2.0.3) database data files, 5,7 redhat platform.
    your help is very appreciated thanks.

    Published by: 938946 on December 31, 2012 04:38

    Your query is unnecessarily complicated and aggregation has messed up.

    View dba_data_files, dba_temp_files, and v$ temp_space_header all have one line per tablespace data file. So, you need to aggregate the values based on the name of the tablespace.

    Similarly, dba_free_space contains a line by "block" of the free space in the tablespace. So, if your tablespace apps_ts say 4 blocks of free space, then it will have 4 rows for the apps_ts tablespace. Yet once, you will need to overall based on tablespace name before anything else.

    The tablespace temp will almost never have any free space because if the Oracle way works. Once a measure is created in the temp tablespace that he is never deallocated. When the transaction who "created" the measure is finished using it, it is marked as being available for other sessions, but it is so more free space.

    The query below, that's what I think you are looking for regular storage space. If you really need to show the temp tablespace, then you can add a third request from the union to that all interview to watch dba_temp_files. If there is a free space in the tablespace temp it will appear in dba_free_space.

    select tablespace_name,
           round(sum(allocated_space) / 1024 / 1024, 2) "Size (MB)",
           round(sum(free_space) / 1024 / 1024, 2) "Free (MB)",
           round((sum(free_space)/sum(allocated_space)) * 100, 2) "% Free",
           round(((sum(allocated_space) - sum(free_space))/sum(allocated_space)) * 100, 2) "%Used"
    from (select tablespace_name, bytes allocated_space, 0 free_space
          from dba_data_files
          union all
          select tablespace_name, 0 allocated_space, bytes free_space
          from dba_free_space)
    group by tablespace_name
    Order by 4
    

    John

  • Create a "movable" image in Flash CS6 Pro

    Hi people,

    First, while the answer would be great, I also hope for people to point me in the right direction to find those answers myself...

    I'm new on CS6 and relatively innexperienced with flash in general (certainly new AS3).

    I work my way through a project and at the present time, I am trying to create a background image or layer, it's great that my canvas, the idea being that you can click and drag the mouse to look around him, but do NOT pull the edges of the image on the Web (I'm sure that there's a better word than canvas also).

    My main problem is that I am struggling with terminology, so while I know what I want to achieve, put in words what experts understand or gives google relevant hits, proves to be a problem.

    I hope someone can help.

    Tim.

    It is quite easy but will require little code. Here is a sample file that you can watch. (which we call the 'Stage' canvas).

    In this example, I made a document size 200 x 200 with an object is 400 x 400. What does the code, is understand how much the image is as the stadium. It will then calculate a rectangle size and position where the object is allowed to drag.

    Example of FLA (recorded in CS4)

    The code is pretty simple:

    what the code to run when the mouse button

    mygfx.addEventListener (MouseEvent.MOUSE_DOWN, handleMouseDownF);

    what code to execute when the mouse is released or leave him

    stage.addEventListener (MouseEvent.MOUSE_UP, handleMouseUpF);

    function handleMouseDownF(e:MouseEvent):void

    {

    get the extra area, we need that it is allowed

    move in (size of the object under the stage size)

    var extraWidth:int = int(mygfx.width-stage.stageWidth);

    var extraHeight:int = int(mygfx.height-stage.stageHeight);

    Use that extra space to make a rectangle of negative value

    mygfx.startDrag (false, new Rectangle)

    (-1 * extraWidth), / / x

    (-1 * extraHeight), / / y

    extraWidth, / / width

    extraHeight)); / / height

    }

    function handleMouseUpF(e:MouseEvent):void

    {

    mygfx.stopDrag ();

    }

    To start I have converted the big ugly object into a symbol (F8), a MovieClip. I then clicked on this MovieClip, and in the properties panel, I gave her the name of the instance 'mygfx '. This allows me to access this object in the code just by using its name, as seen in the code above. I try to keep things simple.

    I have attached a few listeners for the MouseEvent.MOUSE_DOWN events (the user is holding down the button on the left of the mouse on the object) and MouseEvent.MOUSE_UP (the user let go the left button). As you can see, I use a different function for these 2 different events.

    The math is easy, but the concept of what is happening here is a little more difficult to explain.

    When I created the symbol, I used the upper left default record. This means that any time you move the object on the stage, the x / y position reported in the Info Panel will be the location ot the "upper left" object. See the help section if you don't know what are the points of alignment.

    With upper left registration and the object placed at x: 0, y: 0 on the stage, you can see 1/4 of the upper-left corner of the image. In this case, you can use a special function called "startDrag()" on any display object to allow the user to drag. To keep the screen, you can specify a rectangular area, that she should be confined. This is where the simple calculation.

    I subtracted the size of the stages of the large size of the image that told me how many pixels to the left and to the top of the trail has been allowed to go. You want to subtract the size of the stage, reduce you the amount, it can move so that he will not put off the stage. We know that the scene is 200 x 200 and the object is double to 400 x 400, up to 400-200 = 200. So I want to make the limiting Rectangle (-200, -200, 200, 200) encompassing. This means that I can move the negative object 200 pixels and negative left 200 pixels. If you change the size of the object the calculation will calculate the exact amount (as long as the image is larger than the height/width of the scene). Just keep it simple for now.

    Finally, when the user leaves the mouse dragging is stopped with the function "stopDrag()' to display of items.

  • Change images

    Hey.  I have an xml which basically has a structure as follows

    <image title="Mike from Camden" src="images/5.jpg"/>
    

    In as3, I load in the xml file and then manipulated by the practice

    private function handleXML(e:Event):void
    { 
    xml = new XML(e.target.data);
    
         for (var i:int = 0; i < xml.children().length(); i++)
         {
              var loader:Loader = new Loader();
    
              loader.load(new URLRequest(String(xml.children()[i].@src)));
    
              images.push(loader);
              imagesTitle.push(xml.children()[i].@title);
    
              loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
         }
         }
    

    I have then essentially create a container and display each image in that container and view the text where appropriate.  If you click on an image, it zooms in to help

    tween = new Tween(e.target.parent,"scaleX",Strong.easeOut,e.target.parent.scaleX,0.6,0.8,true);
    tween = new Tween(e.target.parent,"scaleY",Strong.easeOut,e.target.parent.scaleY,0.6,0.8,true);
    
    tween = new Tween(e.target.parent,"x",Strong.easeOut,e.target.parent.x,stage.stageWidth / 2 - e.target.parent.width + 15,0.8,true);
    tween = new Tween(e.target.parent,"y",Strong.easeOut,e.target.parent.y,stage.stageHeight / 2 - e.target.parent.height + 15,0.8,true);
    

    Now instead of zooming in on the image original and do expand, I would now like to change the image.  I add another url in my xml that points to another picture.  I can so this load and manipulate.  I then have to perform in the Tween to change to the new image?  I'll add the code in the class below, so you can see everything I do.

    Thank you much for the help

    package classes
    {
         import flash.display.Sprite;
         import flash.display.MovieClip;
         import flash.net.URLLoader;
         import flash.net.URLRequest;
         import flash.display.Loader;
         import flash.events.Event;
         import flash.filters.BitmapFilter;
         import flash.filters.DropShadowFilter;
         import flash.text.TextFormat;
         import flash.text.TextField;
         import flash.text.AntiAliasType;
         import flash.events.MouseEvent;
         import fl.transitions.Tween;
         import fl.transitions.easing.Strong;
         import fl.transitions.TweenEvent;
    
         public class Main extends MovieClip
         {
              var xml:XML;
              var images:Array = new Array();
              var imagesLoaded:int = 0;
              var imagesTitle:Array = new Array();
              var tween:Tween;
              var zoomed:Boolean = false;
              var canClick:Boolean = true;
              var lastX:int;
              var lastY:int;
    
              var textformat:TextFormat = new TextFormat();
              var formatFont:Avenir = new Avenir();
    
              var screen:Sprite = new Sprite();
    
              public function Main():void
              {
                   textformat.color = 0xFFFFFF;
                   textformat.font = formatFont.fontName;
                   textformat.size = 17;
    
                   screen.graphics.beginFill(0x111111, .75);
                   screen.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
                   screen.graphics.endFill();
    
                   loadXML("xml/images.xml");
              }
    
              private function loadXML(file:String):void
              {
                   var urlLoader:URLLoader = new URLLoader();
                   var urlReq:URLRequest = new URLRequest(file);
    
                   urlLoader.load(urlReq);
                   urlLoader.addEventListener(Event.COMPLETE, handleXML);
              }
    
              private function handleXML(e:Event):void
              {
                   xml = new XML(e.target.data);
    
                   for (var i:int = 0; i < xml.children().length(); i++)
                   {
                        var loader:Loader = new Loader();
    
                        loader.load(new URLRequest(String(xml.children()[i].@src)));
    
                        images.push(loader);
                        imagesTitle.push(xml.children()[i].@title);
    
                        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
                   }
              }
    
              private function loaded(e:Event):void
              {
                   imagesLoaded++;
    
                   if (xml.children().length() == imagesLoaded)
                   {
                        removeChild(preloader);
                        prepareImages();
                   }
              }
    
              private function prepareImages():void
              {
                   for (var i:int = 0; i < images.length; i++)
                   {
                        var container:Sprite = new Sprite();
                        var frame:Sprite = new Sprite();
                        var infoArea:Sprite = new Sprite();
                        var infoField:TextField = new TextField();
    
                        frame.graphics.beginFill(0xFFFFFF);
                        frame.graphics.drawRect(-20, -20, images[i].width + 40, images[i].height + 80);
                        frame.graphics.endFill();
    
                        /* Info Area  */
    
                        infoArea.graphics.beginFill(0x111111, 0.75);
                        infoArea.graphics.drawRect(0, 0, images[i].width, 60);
                        infoArea.graphics.endFill();
                        infoArea.y = images[i].height - 60;
    
                        infoField.defaultTextFormat = textformat;
                        infoField.embedFonts = true;
                        infoField.antiAliasType = AntiAliasType.ADVANCED;
                        infoField.width = images[i].width - 5;
                        infoField.height = 20;
    
                        infoField.text = imagesTitle[i];
    
                        // Resize
    
                        container.scaleX = 0.3;
                        container.scaleY = 0.3;
                        
                        // Position
    
                        container.x = stage.stageWidth / 3 + Math.floor(Math.random() * (stage.stageWidth / 4));
                        container.y = stage.stageHeight / 5 + Math.floor(Math.random() * (stage.stageHeight / 5));
    
                        /* Filter */
    
                        var shadowFilter:BitmapFilter = new DropShadowFilter(3,90,0x252525,1,2,2,1,15);
                        var filterArray:Array = [shadowFilter];
    
                        container.filters = filterArray;
                        
                        infoArea.addChild(infoField);
    
                        container.addChild(frame);
                        container.addChild(images[i]);
    
                        infoArea.visible = false;
                        container.addChild(infoArea);
    
                        container.getChildAt(1).addEventListener(MouseEvent.MOUSE_UP, zoomHandler);
                        container.getChildAt(0).addEventListener(MouseEvent.MOUSE_DOWN, dragImage);
                        container.getChildAt(0).addEventListener(MouseEvent.MOUSE_UP, stopDragImage);
    
                        addChild(container);
                   }
              }
    
              private function dragImage(e:MouseEvent):void
              {
                   e.target.parent.startDrag();
              }
    
              private function stopDragImage(e:MouseEvent):void
              {
                   e.target.parent.stopDrag();
              }
    
              private function zoomHandler(e:MouseEvent):void
              {
                   if (! zoomed && canClick)
                   {
                        /* Avoid unwanted clicks */
    
                        canClick = false;
                        addChild(screen);
                        /* Cant drag when zoomed or zooming */
    
                        e.target.parent.getChildAt(0).removeEventListener(MouseEvent.MOUSE_DOWN, dragImage);
    
                        /* Get next highest depth */
    
                        setChildIndex(e.target.parent as Sprite, (numChildren - 1));
    
                        /* Get position */
    
                        lastX = e.target.parent.x;
                        lastY = e.target.parent.y;
    
                        tween = new Tween(e.target.parent,"scaleX",Strong.easeOut,e.target.parent.scaleX,0.6,0.8,true);
                        tween = new Tween(e.target.parent,"scaleY",Strong.easeOut,e.target.parent.scaleY,0.6,0.8,true);
    
                        tween = new Tween(e.target.parent,"x",Strong.easeOut,e.target.parent.x,stage.stageWidth / 2 - e.target.parent.width + 15,0.8,true);
                        tween = new Tween(e.target.parent,"y",Strong.easeOut,e.target.parent.y,stage.stageHeight / 2 - e.target.parent.height + 15,0.8,true);
    
                        tween.addEventListener(TweenEvent.MOTION_FINISH, zoomInFinished);
                   }
                   else if (zoomed && canClick)
                   {
                        e.target.parent.getChildAt(2).visible = false;
    
                        tween = new Tween(e.target.parent,"scaleX",Strong.easeOut,e.target.parent.scaleX,0.3,0.3,true);
                        tween = new Tween(e.target.parent,"scaleY",Strong.easeOut,e.target.parent.scaleY,0.3,0.3,true);
    
                        tween = new Tween(e.target.parent,"x",Strong.easeOut,e.target.parent.x,lastX,0.3,true);
                        tween = new Tween(e.target.parent,"y",Strong.easeOut,e.target.parent.y,lastY,0.3,true);
    
                        tween.addEventListener(TweenEvent.MOTION_FINISH, zoomOutFinished);
                   }
              }
    
              private function zoomInFinished(e:TweenEvent):void
              {
                   zoomed = true;
                   canClick = true;
                   tween.obj.getChildAt(2).visible = true;
              }
    
              private function zoomOutFinished(e:TweenEvent):void
              {
                   zoomed = false;
                   removeChild(screen);
    
                   tween.obj.getChildAt(0).addEventListener(MouseEvent.MOUSE_DOWN, dragImage);
              }
         }
    }
    

    addChild() takes only a DisplayObject instance as an argument, then you must do something like:

    container.addChild(images[i]);
    container.addChild(images2[i]);
    images2[i].alpha = 0;
    
  • addChield problem

    Thanks, but it wasn't her


    I think part of the problem is that I work with external classes.

    I copy my code to be part of my original as a file and it works fine

    but I really want to have it in diferent in the form of files


    _giftCardRoot.as
    [CODE]

    package {}

    import flash.display. *;
    import flash.events. *;
    flash.net import. *;
    import flash.text. *;
    flash.filters import. *;


    public class _giftCardRoot extends Sprite {}
    thumbHSpace:int private static const is 140;.
    thumbVSpace:int private static const is 120;.
    thumbXOffSet:int private static const is 140;.
    thumbYOffSet:int private static const is 95;.
    private var XMLData:XML;
    public var textFormat:TextFormat;

    public void _giftCardRoot() {}
    var MainFunctions:_Class_MainFunctions = new _Class_MainFunctions;
    MainFunctions.LoadXML ("category.aspx"); / / This path does not work
    LoadXML ("category.aspx"); / / Works of this path
    }
    //
    public void LoadXML (myXMLFile): void {}

    trace ("1");
    var xmlURL = new URLRequest (myXMLFile);
    var xmlLoader:URLLoader = new URLLoader (xmlURL);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    }
    //
    private void xmlLoaded(event:Event):void {}
    trace ("2");
    var xmlData = new XML (event.target.data);
    parseXML (xmlData);
    }
    //
    public void parseXML(input:XML):void {}
    trace ("3");
    var hc:int = 0;
    var vc:int = 0;
    var category:XMLList = input.category;
    textFormat = new TextFormat;
    textFormat.font = "Verdana";
    textFormat.size = 11;
    textFormat.bold = true;
    textFormat.color = 0 x 990000;
    for each {(infoXML:XML var in the category)
    var productGroupGUID = new TextField;
    var catImg = new TextField;

    hc = catName.x * thumbHSpace + thumbXOffSet;
    vc = catName.y * thumbVSpace + thumbYOffSet;
    catName.text = infoXML.categoryName;
    catName.setTextFormat (textFormat);

    catName.width = 150;
    If {(hc < 3)
    HC ++;
    } else {}
    HC = 0;
    VC ++;
    }
    addChild (catName);

    bitmapLoader (infoXML.categoryImage, catName.x, catName.y);

    }
    }
    }
    }
    [/ CODE]


    _Class_MainFunctions.as
    [CODE]
    package {}
    import flash.display. *;
    import flash.events. *;
    flash.net import. *;
    import flash.text. *;
    flash.filters import. *;


    public class _Class_MainFunctions extends Sprite {}

    thumbHSpace:int private static const is 140;.
    thumbVSpace:int private static const is 120;.
    thumbXOffSet:int private static const is 140;.
    thumbYOffSet:int private static const is 95;.
    private var XMLData:XML;
    public var textFormat:TextFormat;

    public void LoadXML (myXMLFile): void {}
    trace ("1a");

    var xmlURL = new URLRequest (myXMLFile);
    var xmlLoader:URLLoader = new URLLoader (xmlURL);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    }
    private void xmlLoaded(event:Event):void {}
    trace("2A");
    var xmlData = new XML (event.target.data);
    parseXML (xmlData);
    }
    public void parseXML(input:XML):void {}
    trace("3A");
    var hc:int = 0;
    var vc:int = 0;
    var category:XMLList = input.category;
    textFormat = new TextFormat;
    textFormat.font = "Verdana";
    textFormat.size = 11;
    textFormat.bold = true;
    textFormat.color = 0 x 990000;
    for each {(infoXML:XML var in the category)
    var productGroupGUID = new TextField;
    var catImg = new TextField;

    hc = catName.x * thumbHSpace + thumbXOffSet;
    vc = catName.y * thumbVSpace + thumbYOffSet;
    catName.text = infoXML.categoryName;
    catName.setTextFormat (textFormat);

    catName.width = 150;
    If {(hc < 3)
    HC ++;
    } else {}
    HC = 0;
    VC ++;
    }
    addChildAt (catName);

    bitmapLoader (infoXML.categoryImage, catName.x, catName.y);

    }
    }
    //
    / * private void bitmapLoader (ImageTxt, Image_x, Image_y) {}
    var loader: Loader = new Loader;
    var urlReq:URLRequest = new URLRequest ("images/category /" + ImageTxt);
    Loader.Load (urlReq);
    Loader.x = Image_x;
    Loader.y = Image_y + 20;
    addChild (loader);
    var container: Sprite = new Sprite;
    addChild (container);
    var rect:Sprite = new Sprite;
    rect.graphics.lineStyle (0);
    rect.graphics.beginFill (0xFF0000);
    rect.graphics.drawRect (Image_x, Image_y + 20,100,75);
    rect.graphics.endFill ();
    container.addChild (rect);
    rect.addEventListener ("click", onClick);
    rect.buttonMode = true;
    rect.addChild (loader);
    Rect.filters = [New DropShadowFilter];
    }
    private void onClick (myText): void {}
    trace (MyText);
    }*/
    }
    }




    [/ CODE]

    Add MainFunctions to your list of display:

  • What should be my time to latency resulting?

    Please can someone tell me about what my time of latency that results should be in the Prox 10.2.4 logic?

    I use an interface Apollo Twin Duo Thunderbolt, with a Macbook Pro 15' 2015 of the retina, Quad Core 2.8 ghz, 16gbRam, El Capitan 10.11.3

    In preferences, it indicates the size of buffer 64

    Result 10.2ms (exit 2.1ms) roundtrip latency

    Is this normal?   If this latency is high, how can it be reduced?  I bought the most expensive interface that I could afford!

    It's causing you problems?  Placement of record does not affect latency.

    You can hear with the help of a live microphone or guitar/bass input.

    The round-trip latency is high given the size of buffer, which means that somewhere in the chain either Apple or AU-Apollo has added additional buffers.

    My material RME under Snow Leopard under Logic-9 shows:

    Buffer size 128 round trip latency 7.3ms out 3.7

    "" 64 4.4ms roundtrip latency output 2.2

    ««32 2.9ms roundtrip latency output 1.5»

    Normally the return buffer size is double (or slightly more) that the latency of the output, so in your case, it would be between 4.2 and 4.4ms. The pilot of Apollo or logic or the last OSX added buffers. I wouldn't be surprised if it's not Apple Core Audio, which uses the extra buffering... recent Mac operating systems are too heavy top and ineffective even if it's not that noticeable that the whole system is the additional use buffering, which is why so much RAM and open disk space is necessary. There is also the possibility that the extra buffers are part of the Thunderbolt interface?

  • Extractor to update could not download driver and driver only appear not

    I'm trying to download 2 Windows 7 drivers a 3372. One is the graphics device (hmd608ww) AMD software that fails whenever I try to download. The retriever of the update, it shows a file size different that what appears on the support site. The other driver, I am trying to download is the fast rider storage technology Intel 64-bit (h4it03ww). It is not appear on retriever update, but shows up on the support site. I have the 32 bit (h4is03ww), but does not display 64-bit.

    Any help is greatly appreciated. I saw on another thread that somone had a similar problem with downloads default due to an incorrect file size being listed, perhaps there is a similar issue with hmd608ww.

    I tried to delete this template and then add, but nothing helped. I have renounced the extractor to update, is a nice program, but I also had a lot of drivers who do not have and I still have to go to sift through a bunch of pilots because it goes only by the model and the non-specific type. It is easier to use the Lenovo support site. Thanks for the help though.

  • Mini Strip HD Digital Sony 63

    Will someone kindly advise me regarding Sony 63 Mini Digital HD Tape? Recently, I recorded a six minutes
    part of the band and a few days after I recorded the residual balance of the band...
    A few days later, I captured the content of the entire band using my Sony HDR FX 7 and Windows Movie
    Maker. Once treatment ends the movie file (poperties) indicated the file was more than 10 GB in size.
    All my tapes Mini Digital HD (60 min) from the previous 63 does about 4.3 GB in size. Can be possible
    explain everything that can occur during the process of capture with the size being the concert 10?
    Please advise!

    If your computer is equipped with a Blu - ray disc burner (and you have a Blu - ray disc player), then I definitely suggest that you burn HDV on a BD - R to maintain the quality of the recording. If this is not the case, however, always down convert HDV, you can make a DVD-R or shoot with the DV parameter - which is what it looks like you did in the past for a standard single DVD layer, single-sided, has a capacity of 4.7 GB.

    Since Nero Multimedia Suite 10 supports the DV HDV formats and there may be no need for you to upgrade the software, unless you see a feature on 12 Nero you want.

Maybe you are looking for

  • How can I restore my default browser

    I have problems with my email Go Daddy account. Go daddy said that I need to restore my default browser. I already deleted my history, cookies and cache settings. How can I restore firefox default.

  • connection boxes are missing

    When you try to use a Web site that needs a login and a password, nor watch box and can not click in the box to enter the password and ID

  • Wmb54g doesn't work after firmware upgrade?

    I have a wmb54g wireless music bridge. I just upgraded my Gigabit Wireless-N router. (WRT310N) My bridge worked OK, so I've updated the firmware this morning. Since then, my network will not recognize the WMB54G. I have reset the unit several times a

  • Shortcut Windows 7 to the MS-DOS program icon will not change

    I have an old MS-DOS program that I use and I need to create a toolbar that contains a link to other programs.  However, when I try to change the icon for the shortcut, it passes in the properties box, but does not actually change the icon in the bar

  • June 10 update of Windows 8 wiped everything on my laptop!

    I've updated automatically updates of Windows 8. App, all the files and mischief has been wiped clean - which was in a car was still there, but there were files on the c drive that are not replaceable. I'm waiting for the restoration of my system (ho