round corners for krpano in a Div ?

  • Thanks guys for answering *smile*

    i've found this other thread as well : Mask question

    well, in fact i've found another nice solution with the release of krpano 1.0.8.12,
    with the new <area> mode "border" :
    let's say my html div is 600x400, i got an interface over krpano (topbar and bottombar 30 pxl height) and i setup my krpano area border distant to 29 pxl up and down, then there nothing under my interace topbar and botombar and i can apply a mask in as3

    Code
    var rounded_corner_mask:Sprite = new Sprite();
    rounded_corner_mask.graphics.beginFill(0x0000FF);
                                               //DrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) 
    rounded_corner_mask.graphics.drawRoundRect(0,0,stage.stagewidth,stage.stageheight,10,10); 
    rounded_corner_mask.graphics.endFill();
    rounded_corner_mask.x = 0;
    rounded_corner_mask.y = 0;
    // apply mask to interface :
    //this.mask = rounded_corner_mask;


    //not forget to setup the mask width and height same as stage for resizing event,

    the flash div background color must be the same as html background.

    and with a variable and a callback function, i can round the corners on-demand *thumbsup*

    z

  • well,

    till krpano 1.07, there was inside the demo package,
    a folder called plugins-sources/flash-cs3/flashcomponents/ where you can find : flashcs3exampleplugin1.fla
    (it seems it's no longer provided, and certainly has been replaced by embbedexample.fla)

    so get this .fla,
    put in it :

    Code
    var rounded_corner_mask:Sprite = new Sprite();
    rounded_corner_mask.graphics.beginFill(0x0000FF);
                                               //DrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) 
    rounded_corner_mask.graphics.drawRoundRect(0,0,stage.stagewidth,stage.stageheight,10,10); 
    rounded_corner_mask.graphics.endFill();
    rounded_corner_mask.x = 0;
    rounded_corner_mask.y = 0;
    // apply mask to interface :
    this.mask = rounded_corner_mask;

    and you're done

    if you want dynamicaly round the corner , via your .xml :
    put this in a function :

    Code
    this.mask = rounded_corner_mask;

    and 2 solutions to call this function, as far as i know :

    1- using attributes :
    i don't know, i've tried but fail, because in flashcs3exampleplugin1.fla there no Register and update events, if someone can modify the source, thanks

    2- using a callback function :

    AS3 in your .fla

    and in your .xml, the variable by default :

    Code
    onstart ="set(corners, no_round);"
    
    
    and with a switch btn : onclick="corners_state(%1);"


    that's all folks *tongue*

    z

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!