Scrollpane content
Just to note, this is a completly different question to my last one, which I managed to resolve and posted a solution.
I was noticing that the last row of content added to my scrollpane was being cut off. Apparantly, on researching the problem, it is quite common and something to do with the scrollpane calculates the size from a different point. So I managed to find a way to push my items up so they are not cut off. After my items are added, I create a movieclip, and add it to the very bottom. Then if anything gets cut off, it should be this. So the code is basically
function fileLoaded(event:Event):void {
myXML = XML(event.target.data);
xmlList = myXML.children();
for (var i:int=0; i<xmlList.length(); i++) {
var picURL:String = xmlList[ i ].url;
var picName:String = xmlList[ i ].big_url;
arrayURL.push(picURL);
arrayName.push(picName);
holderArray[ i ] = new Thumbnail(arrayURL[ i ],i,arrayName[ i ]);
holderArray[ i ].addEventListener(MouseEvent.CLICK,onClick);
holderArray[ i ].name = arrayName[ i ];
holderArray[ i ].buttonMode = true;
if (i<nrColumns) {
holderArray[ i ].y = 15;
holderArray[ i ].x = i*103+15;
} else {
holderArray[ i ].y = holderArray[ i-nrColumns].y+103;
holderArray[ i ].x = holderArray[ i-nrColumns].x;
thumbsHolder.addChild(holderArray[ i ]);
var box:MovieClip = new MovieClip();
box.graphics.beginFill(0xFF0000, 1);
box.graphics.drawRect(thumbsHolder.width+20, thumbsHolder.height+20, 20, 20);
box.graphics.endFill();
thumbsHolder.addChild(box);
updateScroller();
I was just wondering whether it is ok to do this, or if there is a better fix for this problem?
cheers
sorry using flash 8
Similar Messages
-
MovieClip(scrollpane.content).gotoAndStop(2);
I need to get my main swf A to tell the swf B (swfB is my scrollpane content or source) to gotoAndStop at frame 2 but it doesn't communicate.
Here is my code on my main swfA:
function xbutton (e:MouseEvent):void {gotoAndStop("p1");MovieClip(sp.content).gotoAndStop(2);}
button.addEventListener (MouseEvent.CLICK, xbutton);
Here is my code on frame 2 in swfB:
stop();
SoundMixer.stopAll();
to better visualise what i am doing; swfA is my website with lots of pages, swfA has one page* that holds my scrollpane, inside my scrollpane is swfB with a flPlayback (*this page is the tv page). when I exit the tv page to another page on my website the tv must stop. swfB has my flPlayBack on frame 1, frame 2 is blank (no tv). Ps: The code in swfB works fine independently! I know this because tested it by adding a button (when pressed it goes to frame 2 and the code does stop the tv).Hi Ned,
sp is on the same frame as the code on the main time frame and as I have mentioned I have tested the code internally within swfB and it works! but controlling swfB from swfA does not work. my identifying mark is SoundMixer.stopAll(); which stops all sound. As my post says sp is only on one frame of my site so seen as MovieClip(sp.content).gotoAndStop(2); happens when I click a button to switch pages a visual identifying mark would not be appropriate.
still, why does this not work? -
I've got a AS3 scrollpane with a content source of an empty clip called holder.
I've got a search function that returns an xmllist and then attaches a movieclip for each node in the list and adds some details from the xml node, then each movieclip gets added to the scrollpane. All this works well.
The contents originally come in "relevance" order, but there are buttons for title and date orders as well. When the user clicks to change the order the xmllist is sorted and the code then figures out where each of the clips should be and TweenLite tweens them from their current location in the scrollpane to their new location. And most of the time this has worked well.
Because of word stemming the words management and managers return the same results (the initial relevance rankings are most likely different). Oddly enough management results "lose" several of the clips when sorting to date or title. Oddly they come back/reappear when putting them back into relevance order. Even stranger, none of this happens with the managers results–the same results, but in a slightly different initial relevance order.
The movieclips are arranged (for those specific results) in 25 rows and are probably about 4500 pixels high. Could that be the source of the problem?
I just noticed the problem at the end of the day, so I haven't had much chance to try and figure it out. Anybody experienced this before? Any ideas?That seems to have fixed it. I'm using the killTweensOf() instead, but it seems that given how many rows of this there were some at the bottom hadn't faded in and still had a low alpha.
-
I am using flash pro 8.
The scrollpane is on the stage and the content path is set to
songButtons_mc, the name of the movie clip that loads into it.
In the first frame of the songButtons movie clip, I have
placed the following code in an actions layer:
function playSong (mc:String,sLabel) {
eval(mc+'_btn').onRelease = function() {
_root.gotoAndStop(sLabel);
the scrollpane component with this code works perfectly until
the movie is loaded into another .swf movie, then nothing works.
How do I get this to work? I am new to using components.
Thanks in advance for your help.
MarkI figured it out... it was as simple as adding this._lockroot
= true; to the main timeline. Maybe there is some other way to do
it as well, but as long as it works this way, this is what I will
use.
thanks everyone. Hope someone else can use this sometime in
the future. -
Can i use loadMovie to set scrollPane content?
i'm trying to load external swf files into a scrollpane. i'm
using the loadMovie command, but when i do , the content extends
outside the scrollPane (no scrolling happens). how can i get around
this in the simplest manner?
thanks.
morganas i found out, the answer is no, instead, one must use:
contentPane.contentPath = "web/web_HED.swf"
where contentPane is the name of the scrollPane. this can be
applied to buttons triggerend to load fresh content into the pane,
or onLoad content. -
Is there a way to unload content from a scrollpane componant?
Hello,
There's is probably an easy answer to this but i'm new to web design and probably took the hard road with using Flash CS4.
My problem is that i have text imported from Photoshop as a movieclip loading into a scrollpane which works the way i want it. However when i click another button which loads content into a UIlLoader componant the text in the scrollpane stays onscreen. How do i get the scrollpane content to unload? The content needs to display in the same space so scrollpane and UILoader are basically ontop of eachother.
Could someone provide a solution?
Many thanksI can't find anything that unloads, though maybe you could load in an empty movieclip instead trying to unload the current one.
Or you could make the scrollpane invisible by setting its visible property to false if that's an option.
Another option would be to use the removeChildAt() method and target the numChildren-1 value of the scrollpane (otherwise you start removing pieces of the scrollpane). -
Adding a progress loader to a dynamic text field / scrollPane
I have a dynamic text field which is loading images from an external html. This text is named scrollPaneImage and is a child of a movieClip called scrollPaneContent. I then load scrollPaneContent into a scroll pane named scrollPane
When the user interacts with my swf different images are loaded into scrollPaneImage. Since some of the images take a few seconds to load, I'd like there to be a progress loader displayed in the scrollpane.
I have tried adding the progress event listner to the dynamic text, the movie clip and the scrollpane and cannot get it to respond or track the loading.
scrollPaneContent.addEventListener(ProgressEvent.PROGRESS,reportProgress);
function reportProgress(e:ProgressEvent):void {
trace(e.bytesLoaded + " loaded out of " + e.bytesTotal);
trace("LOADED");
Can anyone suggest what I might be doing wrong or of another approach?
thanks in advance,
JoshHi KGLAD. Thanks for the response. Yes my code is a little messy. Here I have included everything and tried to do a little cleaning. Is there enough code here for you to get an idea of how/when things are firing?
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.distriqt.gmaps.kml.utils.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.TweenLite;
import flash.geom.Point;
import com.greensock.plugins.*;
TweenPlugin.activate([AutoAlphaPlugin]);
import com.google.maps.controls.NavigationControl;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.controls.OverviewMapControl;
import com.google.maps.overlays.GroundOverlay;
import com.google.maps.overlays.GroundOverlayOptions;
import com.google.maps.LatLng;
import com.google.maps.LatLngBounds;
import com.google.maps.MapMouseEvent;
import com.google.maps.controls.*;
import com.google.maps.overlays.Marker;
import com.google.maps.InfoWindowOptions;
import com.google.maps.overlays.MarkerOptions;
import com.anttikupila.utils.JPGSizeExtractor;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.net.URLLoader;
import fl.controls.UIScrollBar;
import flash.events.Event;
import fl.events.ScrollEvent;
import flash.sampler.NewObjectSample;
[Embed(source="ICONS/PHOTO_BLACK.png")]var photoIcon:Class;
[Embed(source="ICONS/BLOG_BLACK.png")]var blogIcon:Class;
scrollPane
// GMAP PARAMETERS
var map:Map = new Map();
map.key = "map key";
//map.key = "api key";
//define the size of the map extent....
map.sensor = "false";
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
map.addEventListener(MapEvent.MAP_READY, onMapReady);
map.addEventListener(MapEvent.MAP_READY, createmarkers);
map.addEventListener(MapEvent.MAP_READY, createMarkerArrays);
map.addEventListener(MapEvent.MAP_READY, createPhotoPingers);
this.addChild(map);
map.setSize(new Point(stage.stageWidth, stage.stageHeight));
//on map ready params
function onMapReady(event:Event):void
map.setCenter(new LatLng(48,-113.5), 8, MapType.PHYSICAL_MAP_TYPE);
map.enableScrollWheelZoom();
map.disableContinuousZoom();
//Marker options for a photo piece
var photoMarkerOptions:MarkerOptions = new MarkerOptions();
photoMarkerOptions.icon = new photoIcon();
photoMarkerOptions.hasShadow=false;
//Marker options for a blog piece
var blogMarkerOptions:MarkerOptions = new MarkerOptions();
blogMarkerOptions.icon = new photoIcon();
blogMarkerOptions.hasShadow=false;
//load xml tester
var pntloader:URLLoader = new URLLoader();
var pntxml:XML = new XML();
pntloader.addEventListener(Event.COMPLETE, loadpntXML);
pntloader.load(new URLRequest("map_feed.xml"));
// create an array of jpgs to index
var JPGIndexArray:Array = new Array();
//Create array that will be populated with points
var pointsArray:Array = new Array();
//Load the XML
function loadpntXML(e:Event):void {
pntxml=new XML(e.target.data);
pntxml.ignoreWhite = true;
for (var i:int = 0; i< pntxml.row.length(); i++){
pointsArray[i]="mrk"+i;
JPGIndexArray[i]="JPG"+i;
//trace(pntxml);
//Create the markers and add them to the map
function createmarkers(event:Event):void
for (var i:Number = 0; i < pntxml.row.length(); i++) {
var markerOptions:MarkerOptions = new MarkerOptions();
if (pntxml.row[i].TYPE=="PHOTO")
markerOptions.icon = new photoIcon();
markerOptions.tooltip = "Photo";
markerOptions.hasShadow=false;
else if(pntxml.row[i].TYPE=="BLOG")
markerOptions.icon = new blogIcon();
markerOptions.tooltip = "Blog Entry";
markerOptions.hasShadow=false;
else
null
pointsArray[i] = new Marker(new LatLng(pntxml.row[i].LAT,pntxml.row[i].LONG),markerOptions);
markerA.push(pointsArray[i]);
map.addOverlay(pointsArray[i]);
pointsArray[i].addEventListener(MapMouseEvent.CLICK,indexCalledMarkerRecord);
pointsArray[i].addEventListener(MapMouseEvent.CLICK,scrollPanePopulate);
// PING PHOTO DIMENSIONS BEFORE LOADING //
var je : JPGSizeExtractor = new JPGSizeExtractor( );
je.addEventListener( JPGSizeExtractor.PARSE_COMPLETE, jeLoadHandler );
je.addEventListener( JPGSizeExtractor.PARSE_FAILED, jeParseFailed );
function createPhotoPingers(event:Event):void{
for (var k:Number=0; k <pntxml.row.length(); k++){
JPGIndexArray[k]=new JPGSizeExtractor();
JPGIndexArray[k].debug = false;
JPGIndexArray[k].addEventListener(JPGSizeExtractor.PARSE_COMPLETE, jeLoadHandler );
trace("madeit");
pingPhotoUrls();
function pingPhotoUrls():void
for (var i:Number = 0; i < pntxml.row.length(); i++) {
var calledMarkerUrl=pntxml.row[i].URL_OF_CONTENT;
JPGIndexArray[i].extractSize(calledMarkerUrl);
var JPG1=null;
function jeLoadHandler(e:Event) : void {
trace(e.currentTarget.width + "x" + e.currentTarget.height );
imageWidths.push(e.currentTarget.width);
function jeParseFailed( event : Event ) : void {
trace( "Parse failed" );
var imageWidths = new Array;
// FUNCTIONS FOR INDEXING CALLED MARKERS//
//Create blank array for use in indexing
var markerA:Array=[];
//VAR FOR USE IN INDEXING CALLED MARKER
var pointindex=null;
//INDEX CALLED MARKER POINT XML RECORD
function indexCalledMarkerRecord(e:MapMouseEvent):void{
pointindex=genIndexPos(markerA,Marker(e.currentTarget));
//trace(pntxml.row[pointindex].DESC);
//FUNCTION FOR INDEXING CALLED MARKER
function genIndexPos(a:Array,e:Marker):uint{
for(var i:uint=0;i<a.length;i++){
if(a[i]==e){
return i;
return null;
// SCROLLPANE FUNCTIONS //
this.addChild(scrollPane);
scrollPane.setSize(255,300);
scrollPane.x=-200;
scrollPane.y=-200;
scrollPane.alpha=0;
scrollPaneContent.mouseEnabled=false;
spHeader.closeBox.addEventListener(MouseEvent.CLICK, function(eMouseEvent):void
TweenLite.to(scrollPane, .5,{autoAlpha:0,overwrite:true});
spHeader.forDrag.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void
scrollPane.startDrag();
spHeader.forDrag.addEventListener(MouseEvent.MOUSE_UP, function (e:MouseEvent):void
scrollPane.stopDrag();
spHeader.forDrag.buttonMode=true;
spHeader.forDrag.useHandCursor=true;
spHeader.width=300;
scrollPane.source = scrollPaneContent;
scrollPaneContent.scrollPaneText.autoSize='left';
scrollPaneContent.scrollPaneImage.autoSize='center';
scrollPaneContent.scrollPaneImage.autoSize=TextFieldAutoSize.CENTER;
scrollPaneContent.mouseEnabled=false;
scrollPaneContent.scrollPaneText.condenseWhite = true;
// Add listener.
scrollPane.addEventListener(Event.COMPLETE, completeListener);
scrollPaneContent.addEventListener(ProgressEvent.PROGRESS,reportProgress);
function completeListener(event:Event):void {
trace('Scrollpane content loaded');
function reportProgress(e:ProgressEvent):void {
trace(e.bytesLoaded + " loaded out of " + e.bytesTotal);
trace("LOADED");
function scrollPanePopulate(event:Event){
//show scroll pane
scrollPane.x=33;
scrollPane.y=33;
TweenLite.to(scrollPane, .5,{autoAlpha:1,overwrite:true});
TweenLite.to(spHeader, .5,{autoAlpha:1,overwrite:true});
//create the temp variables
var calledMarkerIndex=pntxml.row[pointindex].ID;
var calledMarkerDate=pntxml.row[pointindex].DATE;
var calledMarkerDescription=pntxml.row[pointindex].DESC;
var calledMarkerContent=pntxml.row[pointindex].URL_OF_CONTENT;
var imgWidth=JPGIndexArray[pointindex].width;
var imgHeight=JPGIndexArray[pointindex].height;
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
var imgBoxHeight=scrollPaneContent.scrollPaneImage.height;
var txtHeight=scrollPaneContent.scrollPaneText.height;
var contentHeight=(imgBoxHeight+txtHeight);
scrollPane.setSize(300,(contentHeight+15));
//size the text box
scrollPaneContent.scrollPaneText.width=270;
//if image is wide or tall, scale accordingly and create a string that will be used
if(imgWidth>=imgHeight){
var imgSource:String = "<img src="+"'"+calledMarkerContent+"'"+"width='"+250+"'"+"height='"+150+"'"+"/>";
var calledImgHgh=160;
else
var imgSource:String = "<img src="+"'"+calledMarkerContent+"'"+"width='"+110+"'"+"height='"+167+"'"+"/>";
var calledImgHgh=177;
//fill in the text
scrollPaneContent.scrollPaneImage.htmlText=imgSource;
//scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
//pan the map to the called position
map.panTo(pointsArray[calledMarkerIndex-1].getLatLng())
//add the header to the SP and scale accordingly
scrollPane.addChild(spHeader);
spHeader.x=-1;
spHeader.y=1;
spHeader.width=299;
if (txtHeight>=250){
scrollPane.setSize(300,275);
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription+"<br><br>";
if (txtHeight<=5){
scrollPane.setSize(300,200);
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription;
if (txtHeight>=5){
scrollPane.setSize(300,275);
scrollPaneContent.scrollPaneText.htmlText="<font size='12' color='#000000'>"+calledMarkerDescription+"<br><br>";
// CREATE TEMP VARIABLES FOR POSITIONING AND PLACE DYNAMIC TEXT
var scTextY=scrollPaneContent.scrollPaneText.y;
var scImageY=scrollPaneContent.scrollPaneImage.y;
var scTextHeight=scrollPaneContent.scrollPaneText.height;
scrollPaneContent.scrollPaneText.y=scImageY+calledImgHgh;
//update the scrollpane and reset the scrollbar
scrollPane.update();
scrollPane.verticalScrollPosition=(0);
scrollPane.verticalScrollBar.height=270;
scrollPane.verticalScrollBar.x=281;
scrollPane.verticalScrollBar.y=3;
spHeader.alpha=0;
this.addChild(spHeader);
var photoMarkersArray=new Array();
var photoMarkersIndexArray=new Array();
//CREATE ARRAY OF PHOTO MARKERS
function createMarkerArrays(e:Event):void{
for (var j:int=0; j<pntxml.row.(TYPE=="PHOTO").ID.length(); j++){
var tempMarkerIndex=pntxml.row.(TYPE=="PHOTO").ID[j];
var tempMarkerRef="mrk"+tempMarkerIndex;
photoMarkersArray.push(tempMarkerRef);
photoMarkersIndexArray.push(tempMarkerIndex); -
Email Link inside a Scrollpane
So i have a scrollpane with a movieclip in it. Inside the movieclip i put static text that says "Email Eric" and linked it with mailto:[email protected] but when i test the movie it won't work. So basically i need to know how to link an email to something inside a scrollpane. Any help would be much appreciated. Thanks for your time in advance. I know someone will come thru for me. They always do!
ok....so i made a whole new flash document to make sure i wasnt doing anything wrong
scrollpane instance name = ericScroll
movie clip that scrolls thru scrollpane = content
so i laid out all my stuff going to be a in the movieclip scroll and then put text and made it a movieclip and it's instance name is = email
then i selected all my info including email link and other item to be content and made it all a movieclip(content)
i have 2 layers
site & actions
first frame i made a button the goes to frame 17 where my scrollPane lies. on that frame in my actions i have this code
scrollPane.setStyle("borderStyle","none");
scrollPane.drawFocus = false;
ericScroll.spContentHolder.email.onRelease = function() {
trace("A");
getURL("mailto:[email protected]");
s then when i test movie i click the button that takes me to the scrollpane ....scroll down....press the button and nothing -
Lookup for elements in ScrollPane does not work
Tried to select my flowpane, result is null. With removing the scrollpane it works as expected.
Quote description of lookup method:
"Finds this Node, or the first sub-node, based on the given CSS selector. If this node is a Parent, then this function will traverse down into the branch until it finds a match. If more than one sub-node matches the specified selector, this function returns the first of them. "
VBox vbox = (VBox )FXMLLoader.load(TestClass.class.getResource(fxml));
vBox.lookup("#elementsPane");
<VBox xmlns:fx="http://javafx.com/fxml">
<ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS">
<FlowPane fx:id="elementsPane" VBox.vgrow="ALWAYS" vgap="4" hgap="4" alignment="BASELINE_CENTER">
<styleClass>
<String fx:value="elementsPane" />
</styleClass>
</FlowPane>
</ScrollPane>
</VBox>Seems like a bug. Scrollpane childs list is empty, my flowpane is at scrollpanes content.
-
Accessing MovieClip function of a MC inside a ScrollPane
I have a MC that is too tall for my stage and want to place it inside a ScrollPane. The probelm is accessing functions inside the MC. I have tried scrollpane.content.mc.function but that doesn't work. How do you access a mc inside tghe scrollpane?
>
>
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.375 / Virus Database: 270.13.19/2245 - Release Date: 07/18/09 05:57:00
>
This code sits on the first frame of the swf being loaded into the
ScrollPane:
function setStepComplete(ss:Number,fs:Number):void{
if(ss == fs){
setCheckMark(ss);
}else {
for(var i=ss;i<=fs;i++){
setCheckMark(i);
function setCheckMark(chknum:Number):void{
with (pdiform) {
switch(chknum){
case 0:
step0.gotoAndStop(2);
break;
case 1:
step1.gotoAndStop(2);
break;
case 2:
step2.gotoAndStop(2);
break;
This is the code you suggested, sitting on the second frame; the
ScrollPane is on the first frame (no stops()).
MovieClip(sp_pdiform.content).setStepComplete(0,0); -
Scrollpane scrolldrag and button click problem.
Hi all,
i dublicate my movieclip named mc2. (mc2 in mc1 moviclip). And my scrollpane 's contentpath is mc1. When i do that, it works. but if i make scrolldrag = true, my button in my movieclip doesnt work.
How can i use scrolldrag and button click in scrollpane content ??
thx
TalhaHi,
It works for me. i have a movie clip with button "my_btn". I placed this movie clip inside Scrollpane and enalbed scrollDrag property. I am able to drag the movie clip inside scroll pane. Also when i clicked the button inside the movie clip, i could see event handler getting triggered. I can also drag the movie clip by pressing mouse on the button.
I am not sure whats wrong in your application.
Thanks,
Karthikeyan R. -
Order of elements and events.
INTRO
Hi Oracle community.
A while ago I started a thread here on the forum where I had put three different subjects to be treated. The user jsmith guided me saying that I was supposed to separate things, dividing each subject in a separate thread. The original discussion is at the following link:
Interesting things, however, unknown? StackPane, animations and filters.
ABOUT
So in this discussion, I will be talking about input events and maybe about event filters. I created a JavaFX 8 (b123) application that checks the mouse click on certain nodes. Basically I have a panel of buttons. Behind this panel, I have a scroll pane with rectangles. The rectangles are contained within a Group, and the buttons are in a VBox. The Group is set as ScrollPane content. VBox and ScrollPane are within a StackPane, which becomes the root of scene graph. If we observe the nodes tree, we'll find the following scenario:
IMAGE
Here is my source code:
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ScrollPane;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class ScrollTest extends Application
// MAIN
public static void main(String[] args)
Application.launch(args);
// INSTÂNCIAS
// CONTROLS
private Rectangle[] rectangles;
private ScrollPane scrollP;
private Button[] buttons;
// LAYOUTS
private StackPane root;
private Group group;
private VBox vbox;
// INÍCIO FX
@Override public void start(Stage estagio) throws Exception
this.iniFX();
this.confFX();
this.adFX();
this.evFX();
Scene cenario = new Scene(this.root , 640, 480);
estagio.setScene(cenario);
estagio.setTitle("Programa JavaFX - RDS");
estagio.show();
/** Just instantiate JavaFX objects.*/
protected void iniFX()
// CONTROLS
this.rectangles = new Rectangle[5];
this.scrollP = new ScrollPane();
this.buttons = new Button[6];
// LAYOUTS
this.root = new StackPane();
this.group = new Group();
this.vbox = new VBox();
/** Just sets the JavaFX objects.*/
protected void confFX()
// CONTROLS
for(int count = 0 ; count < this.rectangles.length ; count++)
this.rectangles[count] = new Rectangle();
this.rectangles[count].setWidth(Math.random() * 100 + 20);
this.rectangles[count].setHeight(Math.random() * 100 + 20);
this.rectangles[count].setFill(Color.rgb((int) (Math.random() * 255) , (int) (Math.random() * 255) , (int) (Math.random() * 255)));
this.rectangles[count].setTranslateX(Math.random() * 600);
this.rectangles[count].setTranslateY(Math.random() * 600);
this.rectangles[count].setRotate(Math.random() * 360);
for(int count = 0 ; count < this.buttons.length ; count++)
this.buttons[count] = new Button("Button - " + count);
// this.scrollP.setVbarPolicy(ScrollBarPolicy.ALWAYS);
// this.scrollP.setHbarPolicy(ScrollBarPolicy.ALWAYS);
this.scrollP.setPrefSize(400 , 400);
// LAYOUTS
this.vbox.setAlignment(Pos.CENTER);
this.vbox.setSpacing(20);
// This doesn't solve my problem.
// this.vbox.setMouseTransparent(true);
/** Just create the realtion between nodes, and the root.*/
protected void adFX()
for(int count = 0 ; count < this.rectangles.length ; count++)
this.group.getChildren().add(this.rectangles[count]);
for(int count = 0 ; count < this.buttons.length ; count++)
this.vbox.getChildren().add(this.buttons[count]);
this.scrollP.setContent(this.group);
this.root.getChildren().add(this.scrollP);
this.root.getChildren().add(this.vbox);
/** Just add some events to some nodes for debugging.*/
protected void evFX()
this.vbox.setOnMousePressed(new EventHandler<MouseEvent>()
@Override public void handle(MouseEvent e)
System.out.println("Mouse pressed inside VBox.");
this.scrollP.setOnMousePressed(new EventHandler<MouseEvent>()
@Override public void handle(MouseEvent e)
System.out.println("Mouse pressed inside ScrollPane.");
if(this.rectangles.length > 0)
this.rectangles[0].setOnMousePressed(new EventHandler<MouseEvent>()
@Override public void handle(MouseEvent e)
System.out.println("Rectangle pressed.");
rectangles[0].setFill(Color.rgb((int) (Math.random() * 255) , (int) (Math.random() * 255) , (int) (Math.random() * 255)));
THE PROBLEM
I wish I could click the mouse on VBox buttons, but also in the scroll pane, and in it's internal contents (the rectangles). I tried changing the VBox mouseTransparent property to true, and modify mouseTransparent to false on each VBox button, but that did not work. I've been reading the JavaFX documentation talking about routing events, and found the following:
The route can be modified as event filters and event handlers along the route process the event. Also, if an event filter or event handler consumes the event at any point, some nodes on the initial route might not receive the event.
Could it be that VBox is filtering events so they do not reach ScrollPane? Or is this being done by StackPane in some other manner? Does anyone have any idea what I could do?
In any case, I thank you for your attention.You might need to modify the event dispatch tree so that the events get beyond the VBox. I'm not saying this is the right thing to do, but something worth looking at.
root.setEventDispatcher(new EventDispatcher() {
@Override
public Event dispatchEvent(Event event, EventDispatchChain tail) {
tail.append(group.getEventDispatcher());
return tail.dispatchEvent(event);
There is some info on event processing at Handling JavaFX Events: Processing Events | JavaFX 2 Tutorials and Documentation -
I am loading a swf into a level. I have a scrollPane
component in the SWF
and a preloader.
Now the preloader works but doesn't show the loading bar. I
am assuming this
has something to do with the fact the the scrollPane content
is loading at
Runtime and this is interfering with the prelaoder showing
up? Any thought
on how to get around this?
ThanksOk I've got it. I made mistake when I put URI parameters into *.tld file. Sorry!
-
Hi guys,
I am in a big trouble..... i am attempting to make scrollpane
content accessible for screenreader but unfortunately nothing is
coming out.
suggestions and help is greatly appreciated.
ThanksHi m7nra,
I used the query as
SELECT * FROM table
WHERE testDate + (testTime/(24*60*60)) BETWEEN TO_DATE('MM/DD/YYYY','12.11.2002') AND TO_DATE('MM/DD/YYYY','14.11.2002')
its giving DATE FORMAT NOT RECOGNIZED error.
The Example data is :
testDate ------=-- testTime
11/12/2002 --- 35000
11/12/2002 --- 43000
11/12/2002 --- 45000
11/12/2002 --- 75000
11/13/2002 --- 2000
11/13/2002 --- 3500
11/13/2002 --- 4300
11/13/2002 --- 9800
11/13/2002 --- 23000
11/14/2002 --- 5000
11/14/2002 --- 10000
11/14/2002 --- 15000
infact i need all the records between 11/12/2002 --- 43000 seconds to 11/14/2002 --- 1000 seconds.
Please help me to find a full query beacuse iam very new to Oracle.
Thanks,
S R Mannava -
Custom brushes in Flash like Photoshop?
I just started using Flash for my animations and I want to ask if one can create custom brushes in Flash like Photoshop?
Also I imported an embeded video avi into Flash and I want to reduce the opacity of the video so I can create a new layer over it and draw over the frames with the video as reference.I dragged the movie into the stage and converted to movie clip and reduced the opacity but its not showing on the stage when I go to the part of the video I want to draw over.
I use Flash CS3.
BTW,why isn't the bucket tool & selection tool like Photoshop?It makes shading colours problematic?or is it because its vector?I was not able to access the mc inside the scroll pane with the code:
TweenLite.to(mc_pane2.content.scrollpaneBckgrnd_mc.FloraLytell_btn, 1,
I had to explicitly specify that it is the mc I am accessing inside the
scroll pane, otherwise I was getting errors:
TweenLite.to(MovieClip(mc_pane2.content).scrollpaneBckgrnd_mc.FloraLyt ell_btn,
1, );
That's OK. It's because ScrollPane::content is of a type DisplayObject. DisplayObject does not contain property named scrollpaneBckgrnd. MovieClip, however, is a dynamic class and enables you to (try to) access virtually any property you can imagine. If it doesn't exist in your particular instance of a MovieClip, you'll get an runtime error.
P.S. If you have time can you briefly tell me why is there a line of code
in your sample:
mc_pane2.update();
ScrollPane::update() measures your content and sets scrollbars accordingly, if needed.
Can it be changed with the size specified for the mc_pane2:
mc_pane2.setSize(556, 300);
what would be the major difference between them?
They definitelly don't do the same. ScrollPane::setSize() sets size of your scrollpane If you get same results using one or the other function, it's because your content is smaller than 556x300px and you don't need scrollbars so in this particular case ScrollPane::update() would "do nothing".
Maybe you are looking for
-
OWB process flow & Oracle Workflow
Hi, In order to deploy the OWB process flow packages, is it necessary to have Oracle workflow installed on the Target server? When I tried to deploy a process flow package to the target database (10gR2 db), it required a user called owf_mgr. As far I
-
Using javascript in PDF how to identify insatnces of field on all pages
Hi, I am creating a PDF document with report kind strcuture,so that if i have a field in 1 Page (Header section ) then the field will also be there on Page 2 (Header section ) and so on for all pages. I am basically creating from a tool.So if i have
-
Illustrator CC Wont open on windows 8
My illustrator will not open it keeps showing an error message but I already tried uninstalling and installing it. I even factory restored my computer and it still won't work.
-
BAPI coding for CATSDB TABLE i.e Timesheet DB
BAPI coding for CATSDB TABLE i.e Timesheet DB Points will be rewarded, Thank you, Jagrut BharatKumar Shukla
-
Hi all, I have the following problem regarding XML file. I generate an XML file with following steps: 1) Populate an internal table; 2) Transform the internal table into an xml xstring variable, using CALL TRANSFORMATION command; 3) Write a file in b