A Flash Developer Resource Site

Page 4 of 5 FirstFirst 12345 LastLast
Results 61 to 80 of 81

Thread: external html image

  1. #61
    Senior Member
    Join Date
    May 2016
    Posts
    451
    in simple image load with quality #28

    1- how to control width and height image
    2- load image directly without settings file
    3- how to keep quality and smooth if i add root resize function

    PHP Code:
    Stage.scaleMode "noScale";
    Stage.align "TL";
    var 
    scaleObject = new Object();
    Stage.addListener(scaleObject);
    scaleObject.onResize = function() {
    main.background._width Stage.width;
    main.background._height=Stage.height


  2. #62
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Hi, are the scrollpane styles ok now?

    With ctrl+f you can search for the "SetWidth" function that was called and than set the size you want, the size is being set when the css file is loaded.
    HTML Code:
    SetWidth
    The size of the horizontal scrollpane changes when the sentence size is bigger.

    load css simple scoll (swish)
    combined version (swish)
    Last edited by AS3.0; 02-10-2023 at 12:37 PM.

  3. #63
    Senior Member
    Join Date
    May 2016
    Posts
    451
    yes the scrollpane styles ok now

  4. #64
    Senior Member
    Join Date
    May 2016
    Posts
    451
    what about #61

  5. #65
    Senior Member
    Join Date
    May 2016
    Posts
    451
    After studying and translating the codes

    I noticed adding the values ​​in the styleSheet file, but the implementation is through TextFormat

    Is it possible to dispense with styleSheet and create a TextFormat file using external variables instead of styleSheet?

    for examble


    myformat.font===> load external variable(FontName)
    myformat.size===> load external variable(FontSize)
    myformat.textColor===> load external variable(textColor)
    myformat.bold===> load external variable(bold)

    and use new LoadVars() to load these variables from txt file like this

    FontName=arial

    FontSize=30

    textColor=FF0000

    bold=true
    Last edited by kofa; 02-11-2023 at 03:36 AM.

  6. #66
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Hi, "jpg" is a lossful compression that is made for loading fast & 1 size, If you want the best quality the #1 thing to do is work with large file size images with high dimensions that have "png" compression.

    When the stage is resized a good thing to do is check if the stage width is bigger than the stage height & resize it based on the larger region:
    PHP Code:
    //image scale v1 file.
    function resize(){
    if(
    Stage.width>Stage.height){//If stage width is greater than stage height, work with stage height.
    image_mc._width=int(Stage.height/2)//Image width is stage height /2.
    image_mc._yscale=image_mc._xscale//Scale the image height.
    }else{//Else if stage height is greater than stage width.
    image_mc._width=int(Stage.width/2)//Scale the image based on the stage width.
    image_mc._yscale=image_mc._xscale //Scale the image height based on its current set width.
    }

    For the simple scrollpane v9 I added a bug fix when there is no text inside of the scrollpane.

    At the onselfEvent(load) scripting section for scrollpane v9, when the css file is loaded & the text has no data, we can hide the scrollpane:
    PHP Code:
    //simple scrollpane v9 file.
    if(sentences.length<1){
    _root.ContentScroller.vertScroll.slider._visible=false

    For the combined version I added a bug fix to not scroll text when the pane was not pressed.

    At the initSliderActions scripting section for the combined version, if the pane was not clicked on the text can be set to non selectable to prevent unwanted scrolling, & we can use variables like scroll_ok=false to prevent scrolling actions:
    PHP Code:
    //combined version file.
    if(_root._xmouse>_root.ContentScroller._x&&_root._xmouse<_root.ContentScroller._x+_root.ContentScroller.horScroll._width+_root.ContentScroller.vertScroll.slider._width&&_root._ymouse>_root.ContentScroller._y&&_root._ymouse<_root.ContentScroller._y+_root.ContentScroller._height){//Check if mouse is in the bounds of scrollpane when clicking.
    _root.ContentScroller.scroll_ok=true//Allow scrolling set to true.
    _root.ContentScroller.textArea._text.selectable=true
     
    }else{
    _root.ContentScroller.scroll_ok=false//Mouse was pressed outside of the scrollpane, so set scroll_ok to false.
    _root.ContentScroller.scroll_ok2=true
    _root
    .ContentScroller.textArea._text.selectable=false

    You should use ctrl+f & look for changes done with "scroll_ok" variable.

    The combined version is working really good now.

    download image scale v1 (swish)
    load css simple scoll (swish)
    combined version (swish)
    Last edited by AS3.0; 02-11-2023 at 04:07 AM. Reason: typo on post #62: SetSize(w,h)

  7. #67
    Senior Member
    Join Date
    May 2016
    Posts
    451
    i changed jpg to png but quality not working

  8. #68
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Is that why you wanted to modify image brightness, do you want me to work on this?

    image brightness

    I was thinking about the bytearray class that is just for AS3, we can work on brightness if that will help.
    Last edited by AS3.0; 02-11-2023 at 04:53 AM.

  9. #69
    Senior Member
    Join Date
    May 2016
    Posts
    451
    in load css simple scoll
    when i chang font and setings sentence to my language ===> my language not working
    in old versions working fine

  10. #70
    Senior Member
    Join Date
    May 2016
    Posts
    451
    # 68

    no need brightness but very important for me i want zoom onRover function

  11. #71
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Hello, the arab text seems to be showing fine for me using various font sizes, can you send me a screenshot of the issue:

    load css simple scroll 9.1 (swish)




  12. #72
    Senior Member
    Join Date
    May 2016
    Posts
    451
    yes now working

  13. #73
    Senior Member
    Join Date
    May 2016
    Posts
    451
    dynaic text not working for arab fonts
    you must change font in swish max to _sans

    can you quickly end your font embed project

  14. #74
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Ok, use Arial unicode MS, it seems to work better for selection text.

    Are you talking about the font convertor? I can complete it if you need, I stopped working on it at 65%.

    load css simple 9.2 (swish)
    Last edited by AS3.0; 02-11-2023 at 06:36 AM.

  15. #75
    Senior Member
    Join Date
    May 2016
    Posts
    451
    Yes i need font converter nessary

  16. #76
    Senior Member
    Join Date
    May 2016
    Posts
    451
    only _sans font support arab fonts

    this is old fact in my swish course
    so if you compete font converter =====> Software miracle

  17. #77
    Senior Member
    Join Date
    May 2016
    Posts
    451
    can you check scroll buttons when you drage out =====> blue color still working

  18. #78
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Hello, this is the bug fix for drag out highlight:

    PHP Code:
    onMouseMove=function(){//Check if mouse is moving, the same process is used for onmouseup.
    if(_root.ContentScroller.vertScroll.slider.grip._visible==true){
    _root.ContentScroller.hidden2=false
    }
    if(
    _root.ContentScroller.hidden==false){//If hidden is set to false, check the mouse if it is in the bounds of the vertical scroll bar.
     
    old_w=_root.ContentScroller.vertScroll.slider.bar._width
    if(_root.ContentScroller.horScroll.slider._yMouse>0&&_root.ContentScroller.horScroll.slider._yMouse<_root.ContentScroller.horScroll.slider._height&&_root.ContentScroller.horScroll._xMouse<_root.ContentScroller.horScroll.slider._width&&_root.ContentScroller.horScroll._xMouse>0){//Check if the mouse is in the bounds of the horizontal scroll bar, & use unselected_color or highlight_color_select.
    _root.ContentScroller.createRectangle(-0.5,0,_root.ContentScroller.horScroll.slider._width,_root.ContentScroller.slider_size,_root.ContentScroller.scroller_color,_root.ContentScroller.highlight_color_select,"100%",2,_root.ContentScroller.horScroll.slider)//slider //Set the color of the slider to _root.ContentScroller.highlight_color_select if it is in bounds of the scroller.
    }else{
    _root.ContentScroller.createRectangle(-0.5,0,_root.ContentScroller.horScroll.slider._width,_root.ContentScroller.slider_size,_root.ContentScroller.scroller_color,_root.ContentScroller.unselected_color,"100%",2,_root.ContentScroller.horScroll.slider)//slider  //Set the color of the slider to _root.ContentScroller.unselected_color if it is not in the bounds of the scroller.
    }
    }
    if(
    _root.ContentScroller.hidden2==false){//Repeat the same process for the horizontal scroller.
    old_w=_root.ContentScroller.vertScroll.slider.bar._width
    if(_root.ContentScroller.vertScroll.slider._yMouse>0&&_root.ContentScroller.vertScroll.slider._yMouse<_root.ContentScroller.vertScroll.slider._height&&_root.ContentScroller.vertScroll._xMouse<_root.ContentScroller.vertScroll.slider._width&&_root.ContentScroller.vertScroll._xMouse>0){ //Check if the mouse is in the bounds of the horizontal scroll bar, & use unselected_color or highlight_color_select.
     
    _root.ContentScroller.createRectangle(0,0,old_w,_root.ContentScroller.vertScroll.heig,_root.ContentScroller.scroller_color,  _root.ContentScroller.highlight_color_select,"100%",2,_root.ContentScroller.vertScroll.slider.bar)//slider
    }else{
     
    _root.ContentScroller.createRectangle(0,0,old_w,_root.ContentScroller.vertScroll.heig,_root.ContentScroller.scroller_color,  _root.ContentScroller.unselected_color,"100%",2,_root.ContentScroller.vertScroll.slider.bar)//slider
    }
    }        

    Ok I will get back to you in a few days when I load the fonts in as2.

    load css simple v10 (swish)
    combined version (swish)
    Last edited by AS3.0; 02-11-2023 at 01:01 PM.

  19. #79
    Senior Member
    Join Date
    May 2016
    Posts
    451
    good luck

  20. #80
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Hi, I had to fix the highlight:

    load css simple v12 (swish)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center