is this possible
can you add another vertScroll and rotate it to horizontal
and set text._x +=
Printable View
is this possible
can you add another vertScroll and rotate it to horizontal
and set text._x +=
Yes, But the way to center it is abit different:
At the onSelfEvent(load) is where the main program is, you can center it like this:
At the onSelfEvent(load) is where the main program is:PHP Code:_root.ContentScroller._x=Stage.width/2-scroll_width/2//Inside of the onEnterFrame function.
This program works with the margin-right from the css.PHP Code:onEnterFrame=function(){
var percent=((_root.ContentScroller.horScroll.slider._y)/(_root.ContentScroller.horScroll.tempTrack._height-_root.ContentScroller.horScroll.slider._height))*100 //Produce a horizontal scroll percent.
_root.data_field.text=percent
_root.ContentScroller.textArea._x=-((_root.ContentScroller.textArea._width/100)*percent)+((scroll_width/100)*percent)-(int(padding_right/100)*percent) //Set the textArea._x based on the percent produced.
_root.ContentScroller._x=Stage.width/2-scroll_width/2
}
my_styleSheet.load("styles.css");
loadVariables("settings.txt");
setWidth(Stage.width/2)//Set the width of the horizontal scrollpane with setWidth().
setTimeout(scrollToRight,1)//Call scorllToRight in 1 ms for margin right.
download v3 (swish)
This is the new combined version, the main program to look at is at onFrame(2).
So the combined version checks with the scrollwheel if all of the movieclips are in view to scroll them.
load css simple (swish)PHP Code:var mouseListener:Object = new Object();
Mouse.addListener(mouseListener);
var scrollwheel:Object = new Object();
Mouse.addListener(scrollwheel);
mouseListener.onMouseWheel = function(scr) {
if(scr<0){
for(var i=0;i<item_list.length;i++){
if(item_list[i]._y+item_list[i]._height>Stage.height){
for(var j in _root){//Loop through all stage assets.
if(typeof(_root[j])=="movieclip"){ //If asset is a movieclip, scroll the object _y coordinate minus an amount.
_root[j]._y-=item_list[0]._height/5
}
}
}
}
}else{
if(item_list[0]._y<0){
for(var j in _root){//Loop through all stage assets.
if(typeof(_root[j])=="movieclip"){ //If asset is a movieclip, scroll the object _y coordinate plus an amount.
_root[j]._y+=item_list[0]._height/5
}
}
}
resize()//update resize event.
}
load image simple (swish)
combined version (swish)
Bug fix:
combined version (swish)
load css simple horizontal scroll not working
can you make vertical scroll in the right of text
load css simple (swish)
Hello, for the combined version, I setup a scrolling feature.
At the onFrame(2) scripting section inside of the onMouseWheel function, page scrolling can happen if the css scroller is fully scrolled when the mouse is hovered over it:
load css simple v3 (swish)PHP Code:var scroll_up_ok:Boolean=true//start ok to scroll boolean at true.
var scroll_down_ok:Boolean=true
if(_root._xmouse>ContentScroller._x&&_root._xmouse<ContentScroller._x+ContentScroller.horScroll._width&&_root._ymouse>ContentScroller._y&&_root._ymouse<ContentScroller._y+ContentScroller._height){//Check if the mouse is in the bounds of the css scroller.
if(ContentScroller.vertScroll.slider._y<=0){//Check if the css scroller is fully scrolled up before allowing it to scroll the page up.
scroll_down_ok=true;//Scrolling the page up is ok.
}else{
scroll_down_ok=false//Scrolling the page up is not ok.
}
if(int(ContentScroller.vertScroll.slider._y)+int(ContentScroller.vertScroll.slider._height) >=int(ContentScroller.vertScroll.tempTrack._y)+int(ContentScroller.vertScroll.tempTrack._height)){//Check if the mouse is in the bounds of the css scroller.
scroll_up_ok=true;//Scrolling the page down is ok.
}else{
scroll_up_ok=false//Scrolling the page down is not ok.
}
}
combined version v5 (swish)
Scrollpane fix for 100%:
load css simple v4 (swish)
combined version v6 (swish)
load css simple
can you add a big button horizontal same vertical
padding right not working in load css simple
load css simple
how to change width and height
i tried use parametrers but not working
Hi, margin-right issue was resolved when the value was below 100.
At the onSelfEvent(load) scripting section you can set the size of the scrollpane using setSize:
Inside of the styles.css file you can change the pane colors, & you wanted the horizontal pane larger correct?:PHP Code:_root.ContentScroller.SetSize(600,400)//Set width & height.
_root.ContentScroller._x=0//Set x coordinate.
_root.ContentScroller._y=0//Set y coordinate.
If you are having issues changing with setSize, you have to be accessing it as _root.ContentScroller.SetSize:PHP Code:.heading {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.mainBody {
color: #FF0000;
text-align:right;
font-size:30px;
margin:100;
padding-right:50px;
quality:high;
pane-color:0x370640; //Horizontal pane color.
pane-color2:0xFF0000;//Vertical pane color.
}
If it is still not resizing you can try setting a delayed timer before resizing:PHP Code:_root.ContentScroller.SetSize(200,400)
simple scrollpane v5 (swish)PHP Code:setTimeout(test,300);//Example call to resize in 300ms.
function test(){
_root.ContentScroller.SetSize(200,400)
}
combined version v7 (swish)
We're almost done
https://board.flashkit.com/board/ima.../2023/02/5.jpg
Hello, this version uses the original design:
simple scrollpane v6 (swish)
combined version v8 (swish)
Bug fix on scrollpane alignment.
Simple scrollpane v7 (swish)
combined version v9 (swish)
the end in Simple scrollpane v7
can you Increase the size of the horizontal scroll button and make onRover color same as vertical
in load image simple
can you add smooth quality zoom function as like this
onRollOver = function() { the image quality smooth zoom (w,h) }
without any scroll
if i have _root.main.txtfield
can you write simple code to load external variable without fragmentation on lines
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
}
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.
The size of the horizontal scrollpane changes when the sentence size is bigger.HTML Code:SetWidth
load css simple scoll (swish)
combined version (swish)
yes the scrollpane styles ok now
what about #61
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
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:
For the simple scrollpane v9 I added a bug fix when there is no text inside of the scrollpane.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.
}
}
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:
For the combined version I added a bug fix to not scroll text when the pane was not pressed.PHP Code://simple scrollpane v9 file.
if(sentences.length<1){
_root.ContentScroller.vertScroll.slider._visible=false
}
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:
You should use ctrl+f & look for changes done with "scroll_ok" variable.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
}
The combined version is working really good now.
download image scale v1 (swish)
load css simple scoll (swish)
combined version (swish)
i changed jpg to png but quality not working
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.
in load css simple scoll
when i chang font and setings sentence to my language ===> my language not working
in old versions working fine
# 68
no need brightness but very important for me i want zoom onRover function
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)
https://board.flashkit.com/board/ima.../2023/02/1.png
yes now working
dynaic text not working for arab fonts
you must change font in swish max to _sans
can you quickly end your font embed project
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)
Yes i need font converter nessary
only _sans font support arab fonts
this is old fact in my swish course
so if you compete font converter =====> Software miracle
can you check scroll buttons when you drage out =====> blue color still working
Hello, this is the bug fix for drag out highlight:
Ok I will get back to you in a few days when I load the fonts in as2.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
}
}
}
load css simple v10 (swish)
combined version (swish)
good luck
Hi, I had to fix the highlight:
load css simple v12 (swish)