Clearing the stage

Hi,
using the code below, i've created a basic drag and drop question and answer, where the user can drag the correct answer into the question box. However when moving to the next slide any objects moved on slide 2 remain on slide 2. I've tried removechild but this did not work (i'm probably doing it wrong). I'll add i'm a complete novice, i've only been using falsh for a week now.
Many thanks in advance
var orig1X:Number=item1_mc.x;
var orig1Y:Number=item1_mc.y;
var orig2X:Number=item2_mc.x;
var orig2Y:Number=item2_mc.y;
var orig3X:Number=item3_mc.x;
var orig3Y:Number=item3_mc.y;
var orig4X:Number=item4_mc.x;
var orig4Y:Number=item4_mc.y;
item1_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragTheObject);
item1_mc.addEventListener(MouseEvent.MOUSE_UP, item1Release);
item2_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragTheObject);
item2_mc.addEventListener(MouseEvent.MOUSE_UP, item2Release);
item3_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragTheObject);
item3_mc.addEventListener(MouseEvent.MOUSE_UP, item3Release);
item4_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragTheObject);
item4_mc.addEventListener(MouseEvent.MOUSE_UP, item4Release);
function dragTheObject(event:MouseEvent):void {
var item:MovieClip=MovieClip(event.target);
item.startDrag();
var topPos:uint=this.numChildren-1;
this.setChildIndex(item, topPos);
function item1Release(event:MouseEvent):void {
var item:MovieClip=MovieClip(event.target);
item.stopDrag();
if (dropZone1_mc.hitTestPoint(item.x,item.y)) {
item.x=dropZone1_mc.x;
item.y=dropZone1_mc.y;
} else {
item.x=orig1X;
item.y=orig1Y;
function item2Release(event:MouseEvent):void {
var item:MovieClip=MovieClip(event.target);
item.stopDrag();
if (dropZone2_mc.hitTestPoint(item.x,item.y)) {
item.x=dropZone2_mc.x;
item.y=dropZone2_mc.y;
} else {
item.x=orig2X;
item.y=orig2Y;
function item3Release(event:MouseEvent):void {
var item:MovieClip=MovieClip(event.target);
item.stopDrag();
if (dropZone2_mc.hitTestPoint(item.x,item.y)) {
item.x=dropZone2_mc.x;
item.y=dropZone2_mc.y;
} else {
item.x=orig3X;
item.y=orig3Y;
function item4Release(event:MouseEvent):void {
var item:MovieClip=MovieClip(event.target);
item.stopDrag();
if (dropZone2_mc.hitTestPoint(item.x,item.y)) {
item.x=dropZone2_mc.x;
item.y=dropZone2_mc.y;
} else {
item.x=orig4X;
item.y=orig4Y;
function reset(event:MouseEvent):void {
item1_mc.x=orig1X;
item1_mc.y=orig1Y;
item2_mc.x=orig2X;
item2_mc.y=orig2Y;
item3_mc.x=orig3X;
item3_mc.y=orig3Y;
item4_mc.x=orig4X;
item4_mc.y=orig4Y;
item1_mc.buttonMode = true;
item2_mc.buttonMode = true;
item3_mc.buttonMode = true;
item4_mc.buttonMode = true;
reset_btn.addEventListener(MouseEvent.CLICK, reset);
reset_btn.buttonMode = true;
stop();
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);
function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
gotoAndStop(3);

Sorry for the poor terminology. I have 1 slide/scene with a question and the answers, then I have one button that resets and one that moves on to the next question, but when I move to the next question (I inserted another frame) any items moved in previous question appear with the next. Sorry if I'm not explaining myself very well but I've only been using flash since last Saturday.
Thanks

Similar Messages

  • How to clear the stage when entering a new frame

    Dear all,
    I am making my first website in flash based on frames. When you go to an other frame the Stage fades out. When you enter the frame you see nothing at all. So how can I clear the stage when entering the frame or even better it fades into the frame with clearing the objects & code of the previous frame.
    Hope somebody can help me with this!
    /*buttons naar frames*/ homehome.mouseChildren = false; homehome.buttonMode = true; homehome.addEventListener(MouseEvent.CLICK, actie5); homehome.addEventListener(MouseEvent.ROLL_OVER, actie5); homehome.addEventListener(MouseEvent.ROLL_OUT, actie5); var fadetimer:Timer; var st:MovieClip = new MovieClip(); function actie5(event:MouseEvent):void {   //klikken if(event.type == "click"){ st.graphics.beginFill(0xFFFFFF); //Choose your color to fade.         st.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);         st.graphics.endFill();         st.alpha = 0;         stage.addChild(st);         fadetimer = new Timer(100);         fadetimer.addEventListener(TimerEvent.TIMER, fadeStage);         fadetimer.start(); }   //roll over   if(event.type == "rollOver"){     infohome.text = "je staat op de knop";   }   //roll off   if(event.type == "rollOut"){     infohome.text = "";   } } function fadeStage(te:TimerEvent):void {     if (st.alpha < 1) {         st.alpha += 0.05;     } else {         fadetimer.stop();         fadetimer.removeEventListener(TimerEvent.TIMER, fadeStage);         gotoAndStop(7);     } }
    Thanks a lot for your time

    sorry can't get the code working properly onwith the html code function. Sorry for that

  • Displaying the value of an variable on the stage

    I have managed to display the values contained in string variables on stage, and I am happy with that, however when I wish to display the value of an int and convert it to a string as one is supposed to do the output to the stage just calls it [class int] and does not give its value. any suggestions?
    My rogram contains a stage at frame 1 which displays a word. The user must input a word. Frame 30 then displays the word which was displayed and the word input by the user. That all works fine. But the value of the variable NumberRight, which has been assigned to that variable will only display as [class int] without showing its value. (even though I have converet it to a string using the .to string function you see below).
    My code is as follows;
    trace( "The number correct was" + NumberRight); //This works fine in the output window and shows the value of the variable as NumberRight [class int]1 (showing the value to be 1)
    outputText.appendText("in/"+textAtIN); //this works fine displaying the word presented and word input by user as in/in
    outputText.appendText( NumberRight.toString(     )); //here lies the problem as it just displays [class int] and nothing else.
    Yes I have managed to overcome that problem it was some code on the first frame, please excuse, however, now, is there any way to remove the [class int] bit from the displays, I wish to have the results as a clear copy of the results so that they can be printed out, without [class int] all over the place?

    Hi Ned thanks for that. Yes I had accidently created blank spaces in the String() argument. (wanted to check if there was a subsequent difference in display and forgot to return them to normal ...Sorted )
    Your next suggestion has eliminated the [class int] but I get a value now of 0.
    My code on the first frame for a correct response for example is;
    function keyPressedIN(event:KeyboardEvent):void
              if (event.keyCode == 13)/*Normally,this will move straight on to the next frame-
              recording a correct response and all that that implies in terms of scores etc. But now I have re directed it to Frame 30 to check are the variables working properly*/
                        //insert code for correct responses vowels etc.
                        VowelI = VowelI+1;
                        NumberRight = NumberRight +1;
                        stage.focus = stage;
                        //There is no need to display the text box as this is a correct response.
                        pupilsResponseIN.visible = false;
                        mainText.visible = false;
                        gotoAndPlay(30);//at the moment this takes me to the display frame to check if all is ok
    On the first frame when the user say hits the Return key my code assigns the value of +1 to the variable; eg
    NumberRight=NumberRight+1;
    and the value of +1 to the value of VowelI
    VowelI=VowelI+1
    At Frame 30 the code is as follows;
    stop();
    trace( "The number correct was"+ NumberRight);
    outputText.appendText("in/"+textAtIN);
    outputText.appendText( "\n");
    outputText.appendText("Vowels Correct ="+(int(VowelI).toString()));
    outputText.appendText( "\n");
    outputText.appendText("TotalCorrect="+(int(NumberRight).toString()));
    //outputText.appendText( VowelI.toString());
    Now what I am getting  is
    in/in
    Vowels Correct = O
    Total Correct = O
    Yet the trace (output box) records the Number correct as [class int]1 
    many years ago I wrote this same program in Authorware using similar code. I am trying to re write it in FlashCS5 using ActionScript 3 and It take days to solve small problems. I notice also that If for example the user of the program makes an error and I record the error as NumberRight =NumberRight -1 the program records it as Total Correct = NaN .
    I gave up on this a few months back but I am trying again. I think there must be a better way to do this. Variables do not seem to add up or subtract for me at present. no doubt its me thats got it wrong.

  • Firefox keeps running in the backround after closing it, it just lingers there, and when I try to restart firefox, it says that I have to close the current one or restart my system to clear the last firefox. what can I do, thanks...

    After the last update, my IBM Clone computer does not close the session of firefox when clicking on "close" it clears the screen back to the desktop but firefox continues to hang there in the backround and will not allow another session of firefox to start until the first session is closed. The only way to reconnect is to do a restart on my system, and then the old firefox session is closed and the new session will start.

    Must be the "hang at exit" problem. <br /><br />
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #Why Firefox may hang:
    #*[http://support.mozilla.com/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.com/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably and Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.com/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Windows 8.1 Pro - Flash Pro: Menu's and window selection panes do not fully render, or are misaligned. Same with the stage

    This bug makes the program virtually unusable for anyone using Windows 8.1.  I have a dual screen setup : 1920 x 1200 and 1920 x 1080 on the other, AMD Radeon HD 5700 Series drivers (Latest versions), running on a Windows 8.1 Pro OS.  When you attempt to view the various menu option panes, the windows themselves are not rendering fully, or you are hidden.  Also the stage is shifted as well to the lower right, making the program almost unusable. I have tested this on a Mac, as well as on a windows 7 machine and this does not occur there.  So it appears to be only within a Windows 8.1 Pro machine.   I have attached screen shots of what I am seeing.  Notice in the first image, we are looking at the new document pane. You cannot see the options fully and they are shifted to the right out of view.  The next image shows both the stage, shifted right, as well as the Document Pane.  The options are not fully visible, and clipped off.  The window itself is not re-sizable.  I have cleared the appdata, and re-installed the program. Same result.  I attempted to troubleshoot this via chat, however your network kept losing connection. Please let me know if anyone is suffering from this, and any resolution. Thanks!

    Thank you sir!  The scaling was the issue, and the solution.  By clicking on settings->Screen Resolution-> Text and Font link ->  It was defaulted to 125%. For anyone else who has this issue, set it to 100% and it will resolve these issues.
    Thanks again! Back to development

  • How to effectively remove a loaded SWF from the stage?

    I can not figure out a proper coding to remove a loded SWF from the stage.
    Here is my set up.
    I have a layout segmented into labeled section. In the section labeled "products" I have a layout consisting of product images acting as buttons which bring a user to another labeled section "prdctsPopUps"
    In the "prdctsPopUps" section I have placed an instance of LoaderMax placed into an mc container. Placing LoaderMax into an mc container automatically resolved an issue of clearing loaded SWFs from stage when I come back to "products" section.
    I specified the variable in the "products" section with the following set up:
    var sourceVar_ProductsPopUps:String;
    function onClickSumix1PopUp(event:MouseEvent):void {
                        sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    So each button has its own "....swf" URL and they all open fine and I can come back to "products" section without any issues.
    However inside the swf (which loads through LoaderMax which is placed into an mc) there are other buttons which bring a user to labeled section "xyz". Which also functions properly. It opens as it is supposed to be and without any previously loaded "...swf" on the stage.
    At the labeled section "xyz" there is a limited set of buttons repeating from section "products" which has to bring a user back to the same set up in the "prdctsPopUps" labeled section and open a corresponding "...swf" .
    However only the last opened "...swf" will appear in that section. Effectively the one which was originally opened from the "prdctsPopUps" section and not the one which was supposed to be opened from the "xyz" section.
    I can not understand why it would work from one labeled section and not from another. I can not figure out on which section which code/function needed to be placed.
    Here is the set up from a button from the "xyz" section whcih supposed to bring a user to the same "prdctsPopUps" section but to load a different "...swf"
    var sourceVar_ProductsPopUps_fromXYZ:String;
    function onClick_floralytePopUp_fromXYZ(event:MouseEvent) :void {
                        sourceVar_ProductsPopUps_fromXYZ="prdcts_popups/floralyte-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    Here is the code set up for the LoaderMax from the "prdctsPopUps" section:
    var loaderProductPopUps:SWFLoader = new SWFLoader(sourceVar_ProductsPopUps,
                                                                                                        estimatedBytes:5000,
                                                                                                        container:holderMovieClip,
                                                                                                        onProgress:progressHandler,
                                                                                                        onComplete:completeHandler,
                                                                                                        centerRegistration:true,
                                                                                                        alpha:1,
                                                                                                        scaleMode:"none",
                                                                                                        width:540,
                                                                                                        height:730,
                                                                                                        crop:true,
                                                                                                        autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();
    Is there something which needs to be imported, or specific function needs to be specified in a specific labeled section?

    actually, i think you'll need to use something like:
    var loaderProductPopUps:SWFLoader;
    if ((loaderProductPopUps){
    if(loaderProductPopUps.content)){
       loaderProductPopUps.unload();
    loaderProductPopUps= new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
                                                                                                         estimatedBytes:5000 ,
                                                                                                         container:holderMov ieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
                                                                                                                                                                         // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
                                                                                                                                                                         // can be any size, can not be scaled as it distorts the content
                                                                                                         onProgress:progress Handler,
                                                                                                         onComplete:complete Handler,
                                                                                                         centerRegistration: true,
                                                                                                         //x:-260, y:-320, //no need for this is if used: centerRegistration:true,
                                                                                                         alpha:1,
                                                                                                         scaleMode:"none",
                                                                                                         //scaleX:0, scaleY:0,
                                                                                                         //vAlign:"top",
                                                                                                         width:540,
                                                                                                         height:730,//scales proportionally but I need to cut off the edges
                                                                                                         crop:true,
                                                                                                         autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              //TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();

  • Need to clear the terminal

    Hey, me and my friend are writting a program which I will eventually put into a nice GUI but for the beginning develpmental stages I running it in command line. I am using BlueJ to program, I am not sure it matters, but the point I am getting to is, I have spend nearly a week pulling my hair our trying to something I thought would be as simple as some of the other languages. I just want to clear the screen of the terminal and I have searched the web near and far and tried everything i could find and I still came out with nothing. So if someone could tell me how to clear the screen and put the cursor back in the upper-left hand corner I would be incredible grateful.

    I dunno that i neccesarially need to be able to do it because like DrClap said it is more important to make the GUI look nice but it was more of a this should be easy... why isn't and how can I do it. I appreciate the help though but I am using windows Xp so the I can't get the ASCI thing to work and the brute force thing puts the cursor in the bottom left hand corner instead of the top... Is there a command to make the cursor go back to the top?

  • The problem about the Stage's minWidth or minHeight property.

    From the JavaFX 2.2 api, I see the minWidth or minHeight property, and then I attempt to use them to limit the contraction of stage when dragging. But it takes no effect. Are there some implications for using these properties?
    I have finally to write some codes in the dragging listener of the stage to set manually width or height of the stage to achieve the minWidth or minHeight effect.

    Hi, here is the test case: when we resize the stage UNDECORATED by dragging, we can minimize the stage size to zero even I set the minWidth and minHeight properties at first.
    import javafx.animation.KeyFrame;
    import javafx.animation.KeyValue;
    import javafx.animation.Timeline;
    import javafx.application.Application;
    import javafx.beans.binding.DoubleBinding;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Bounds;
    import javafx.geometry.Point2D;
    import javafx.scene.Cursor;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.ScrollPane;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.effect.Reflection;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.layout.FlowPane;
    import javafx.scene.layout.Pane;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.Window;
    import javafx.util.Duration;
    public class TestMinSizeStage extends Application {
      private ScrollPane scrollPane;
      private ObjectProperty<Point2D> anchor = new SimpleObjectProperty<Point2D>(null);
      private SimpleDoubleProperty widthStage = new SimpleDoubleProperty();
      private SimpleDoubleProperty heightStage = new SimpleDoubleProperty();
      public static void main(String[] args) {
      launch(args);
      @Override
      public void start(final Stage primaryStage) {
      Pane mainContainer = initstage(primaryStage);
      mainContainer.getChildren().addAll(
      createButton());
      primaryStage.show();// Show the primaryStage
      private Pane initstage(Stage primaryStage) {
      primaryStage.setTitle("Hello Java");
      primaryStage.initStyle(StageStyle.TRANSPARENT);
      /* The minWidth or minHeight is for the stage "DECORATED", it has on effect to the stage non "DECORATED". */
      primaryStage.setMinWidth(600);
      primaryStage.setMinHeight(400);
      final FlowPane mainContainer = new FlowPane();
      mainContainer.setStyle(
      "-fx-background-color: white; " +
      "-fx-background-radius: 10px; " +
      "-fx-padding: 10px;" +
      "-fx-hgap: 30px; " +
      "-fx-vgap: 50px;");
      scrollPane = new ScrollPane();
      scrollPane.setStyle("-fx-background-radius: 10px;");
      scrollPane.setContent(mainContainer);
      scrollPane.setPannable(true);
      mainContainer.prefWidthProperty().bind(new DoubleBinding() {
      super.bind(scrollPane.viewportBoundsProperty());
      @Override
      protected double computeValue() {
      Bounds bounds = scrollPane.getViewportBounds();
      if (bounds == null) {
      return 0;
      } else {
      return bounds.getWidth();
      AnchorPane root = new AnchorPane();
      root.setStyle(
      "-fx-border-color: black; " +
      "-fx-border-width: 1px; " +
      "-fx-border-radius: 10px; " +
      "-fx-background-color: rgba(0, 0, 0, 0); " +
      "-fx-background-radius: 10px;");
      DropShadow dropShadow = new DropShadow();
      dropShadow.setRadius(20.0);
      // dropShadow.setSpread(0.2);
      root.setEffect(dropShadow);
      enableDragging(root);
      root.getChildren().add(scrollPane);
      AnchorPane.setTopAnchor(scrollPane, 0.0);
      AnchorPane.setRightAnchor(scrollPane, 10.0);
      AnchorPane.setBottomAnchor(scrollPane, 10.0);
      AnchorPane.setLeftAnchor(scrollPane, 10.0);
      AnchorPane superRoot = new AnchorPane();
      superRoot.getChildren().add(root);
      AnchorPane.setTopAnchor(root, 10.0);
      AnchorPane.setRightAnchor(root, 10.0);
      AnchorPane.setBottomAnchor(root, 10.0);
      AnchorPane.setLeftAnchor(root, 10.0);
      Scene scene = new Scene(superRoot, 950, 650, Color.TRANSPARENT);
      scene.getStylesheets().add(getClass().getResource("controls.css").toExternalForm());
      primaryStage.setScene(scene);
      return mainContainer;
      * Enable the root node to be dragged. Realize some drag functions.
      * @param root - the root node
      private void enableDragging(final AnchorPane root) {
      /* This mouse event is for resizing window. Define some specific cursor patterns. */
      root.setOnMouseMoved(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
      if ((me.getX() > root.getWidth() - 10 && me.getX() < root.getWidth() + 10)
      && (me.getY() > root.getHeight() - 10 && me.getY() < root.getHeight() + 10)) {
      root.setCursor(Cursor.SE_RESIZE);
      } else if (me.getX() > root.getWidth() - 5 && me.getX() < root.getWidth() + 5) {
      root.setCursor(Cursor.H_RESIZE);
      } else if (me.getY() > root.getHeight() - 5 && me.getY() < root.getHeight() + 5) {
      root.setCursor(Cursor.V_RESIZE);
      } else {
      root.setCursor(Cursor.DEFAULT);
      /* when mouse button is pressed, save the initial position of screen. */
      root.setOnMousePressed(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
      Window primaryStage = root.getScene().getWindow();
      anchor.set(new Point2D(me.getScreenX() - primaryStage.getX(), me.getScreenY() - primaryStage.getY()));
      widthStage.set(primaryStage.getWidth());
      heightStage.set(primaryStage.getHeight());
      /* when mouse button is released, clear the initial position of screen. */
      root.setOnMouseReleased(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
      anchor.set(null);
      /* when screen is dragged, translate it accordingly. */
      root.setOnMouseDragged(new EventHandler<MouseEvent>() {
      public void handle(MouseEvent me) {
      if (anchor.get() != null) {// The drag event on the root really takes place.
      Window primaryStage = root.getScene().getWindow();
      if (root.getCursor() == Cursor.H_RESIZE) {
      primaryStage.setWidth(widthStage.get() + (me.getScreenX() - (anchor.get().getX() + primaryStage.getX())));
      } else if (root.getCursor() == Cursor.V_RESIZE) {
      primaryStage.setHeight(heightStage.get() + (me.getScreenY() - (anchor.get().getY() + primaryStage.getY())));
      } else if (root.getCursor() == Cursor.SE_RESIZE) {
      primaryStage.setWidth(widthStage.get() + (me.getScreenX() - (anchor.get().getX() + primaryStage.getX())));
      primaryStage.setHeight(heightStage.get() + (me.getScreenY() - (anchor.get().getY() + primaryStage.getY())));
      } else {// moving the stage
      primaryStage.setX(me.getScreenX() - anchor.get().getX());
      primaryStage.setY(me.getScreenY() - anchor.get().getY());
      * Define a button
      * @return a button
      private Node createButton() {
      Button button = new Button();
      button.setEffect(new Reflection());
      button.setText("Say 'Hello Java'");
      button.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
      System.out.println("Hello Java!");
      /* add an animation effect */
      Timeline timeline = new Timeline();
      timeline.setCycleCount(Timeline.INDEFINITE);
      timeline.setAutoReverse(true);
      timeline.getKeyFrames().addAll(
      new KeyFrame(Duration.ZERO, new KeyValue(button.opacityProperty(), 1.0)),
      new KeyFrame(new Duration(5000), new KeyValue(button.opacityProperty(), 0.0)));
      timeline.play();
      /* set CSS style */
      button.setStyle(
      "-fx-font: 14px 'Cambria'; " +
      "-fx-text-fill: #006464; " +
      "-fx-background-color: #e79423; " +
      "-fx-background-radius: 20.0; " +
      "-fx-padding: 5.0;");
      return button;

  • Items off the stage are showing up in the browser. How do I stop this?

    When learning Flash, I was taught in the beginning that only items that appear on the stage actually show up in the final animation.  Clearly, these people were wrong.  I thought it would be easy to have some text move in from off the right side of the stage to the middle, but the text still shows up even before it enters the stage in the browser.  I have tried to change this using various publishing options, HTML, and CSS, with no luck.  I did have to resize the stage, and I'm not sure if that means anything.  Can someone help me figure this out? Thank you.
    -Chris

    Here are a few things I noticed:
    No DOCTYPE for the page:
    http://www.w3schools.com/tags/tag_doctype.asp
    then validate the code here:
    http://validator.w3.org/
    Next, your main container is 1000px wide (as per your CSS) but in your IE conditional you are placing a 1500 px wide .swf inside.
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1500" height="217.....
    so for course that won't work. In IE that results in a bottom scroll bar no matter how wide a monitor... it's never wide enough to display without scrollbar
    FF is different because:
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="topbanner.swf" width="713" height="155">
    You're using smaller dimensions....so set them both the same.
    If your main container is 1000px wide, then the stage size of your .swf should be 1000px, not 1500, not 713. Then set the width/height of the <div> holding your .swf to the exact same size as the .swf. That should eliminate any off stage stuff from showing.
    Best of luck!
    Adninjastrator

  • Clearing the TextArea texts when I press Enter key

    How to clear the texts that I have typed into the TextArea when I press Enter Key?
    I have now added a TextArea instance called input_txt to the stage and added an component event listener to detect when I press enter key. Then an event fires up which first reads the input to a string variable.
    But next I need to automatically clear the texts in the TextArea.
    How to do that?
    function readInput(event:Event):void
        input = input_txt.text;
        trace(input);
        // removing texts in the text input area-------- how?
    input_txt.addEventListener(ComponentEvent.ENTER, readInput);
    Please help.
    Thank You

    ComponentEvent.ENTER occurs before the line feed is added to the text, and is not cancelable, so you'll probably need to set a flag and do the clearing in an Event.CHANGE handler. Something like this:
    import fl.events.ComponentEvent;
    input_text.addEventListener(ComponentEvent.ENTER, readInput);
    input_text.addEventListener(Event.CHANGE, changeHandler);
    var clearing:Boolean=false;
    function readInput(event:Event):void
        input = input_txt.text;
        trace(input);
        clearing=true;
    function changeHandler(event:Event)
    if(clearing)
      input_text.text="";
      clearing=false;

  • Stretch the Stage to Fill the Browser Window??

    Could someone let me know how this is done.....
    http://www.chevaldetroie.net/
    How do you make the stage fill the entire window and scale?
    Also, How do you position the objects in on the sides, such as the
    menu bar which rolls in and out of the side of the screen. It seems
    like there are MOST of the top designers are doing this now.
    I would appreciate your help.
    Thanks
    Kit

    Kit,
    > This is starting to make sense to me!
    Cool!
    > I have another question. How do you make movie clips
    animate
    > in and then animate out when another button is clicked?
    ... The
    > closest I got was in this site I created a while back...
    >
    >
    http://www.corduroyblues.com
    Aha. Okay, for something like that -- and there are usually
    half a
    dozen ways to do things -- I would probably use keyframe
    scripts, along with
    a variable, in the movie clips that animate in and out.
    I don't know how you coded up or arranged that site, of
    course, but my
    guess is that your nav buttons each tell a particular movie
    clip to load and
    start playing. That's why these clips suddenly disappear:
    because you're
    simply loading them into the same container, and as soon as
    the new one
    comes in, the other vanishes. Makes sense. So you may want to
    shift part
    of the responsbility of this loading onto the movie clips
    themselves. I'll
    try to explain this in a way that makes sense.
    Rather than having your button simply load a movie clip,
    have it set a
    variable instead. Maybe your variable is called clipToLoad.
    It could be a
    variable that sits in the main timeline and starts out empty.
    var clipToLoad:MovieClip;
    It's eventually going to refer to a movie clip, but it
    doesn't yet.
    Now your buttons need to do a couple things: a) check if
    clipToLoad has
    a value yet and b) set a value, then maybe load a movie clip.
    The first
    time around, your variable will be undefined. That makes
    sense, because it
    hasn't been given a value yet; it's only been declared. So if
    it doesn't
    have a value, load a clip:
    someButton.onRelease = function():Void {
    if (clipToLoad == undefined) {
    // clip loading code here
    With me so far? Outside of the if() statement, you may very
    well be
    doing something along these lines. From this point forward,
    you don't want
    buttons to load movie clips on their own, you only want them
    to let Flash
    know which movie clip to load *next*. The trigger to make
    this decision is
    that if() statement, and the if() statement looks to the
    value of
    clipToLoad, so ... to make sure the button knows better next
    time, give
    clipToLoad a value. Watch how the event handler updates:
    someButton.onRelease = function():Void {
    if (clipToLoad == undefined) {
    // clip loading code here
    clipToLoad = movieClipA;
    movieClipA is just a hypothetical instance name for the
    movie clip
    associated with this button. You want that new part outside
    of the if()
    statement, so that it happens every time. So, again ... the
    first time this
    button is clicked, it loads the associated movie clip
    (movieClipA) and sets
    the value of clipToLoad so that it *won't* load the movie
    clip next time.
    So now we need an else.
    someButton.onRelease = function():Void {
    if (clipToLoad == undefined) {
    // clip loading code here
    } else {
    clipToLoad.play();
    clipToLoad = movieClipA;
    So what's the play() about? At this point, we're on the
    second click.
    This button -- or one the others in this nav (which have all
    been coded
    similarly) -- will check clipToLoad and see that it's no
    longer undefined,
    so it'll tell the relevant clip to play. How does it know
    which clip to
    play? Well, the value of clipToLoad tells it so. (This
    variable, after
    all, is a reference to one of the movie clips.)
    Every one of these clips will have an animate-out sequence
    that ends in
    a keyframe script. The keyframe script will contain whatever
    ActionScript
    you're using to load these clips. There, again, it'll know
    which clip to
    load because it will check the value of clipToLoad to find
    out. Perhaps
    something like ...
    this._parent.loadMovie(clipToLoad);
    ... or whatever ActionScript you're using to load these movie
    clips.
    Here's the sequence. First time around, the user clicks the
    button for
    movieClipA. The if() statement checks clipToLoad, finds that
    it's
    undefined, and loads movieClipA on its own, then sets the
    value of
    clipToLoad to movieClipA. At this point, movieClipA loads and
    animates in.
    movieClipA has a stop() action in the keyframe immediately
    after its
    animate-in sequence ends. The second time around, the user
    clicks the
    button for movieClipB. movieClipB's button checks the value
    of clipToLoad
    and finds that it is *not* undefined: it has a value. Okay,
    so it goes to
    its else clause and executes the expression
    clipToLoad.play(). Since the
    value of clipToLoad is currently movieClipA, that's the clip
    that starts
    playing. Then the button changes the value of clipToLoad to
    movieClipB.
    someButtonA.onRelease = function():Void {
    if (clipToLoad == undefined) {
    // clip loading code here
    } else {
    clipToLoad.play();
    clipToLoad = movieClipA;
    someButtonB.onRelease = function():Void {
    if (clipToLoad == undefined) {
    // clip loading code here
    } else {
    clipToLoad.play();
    clipToLoad = movieClipB;
    After movieClipA animates out, it hits the last frame in its
    timeline.
    That frame ias a script that references clipToLoad (which is
    now movieClipB)
    and tells that movie clip to load.
    Don't know if I made that clear as mud. Hope that made
    enough sense
    that you can start experimenting with it. :)
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Using LabView to serial interface my microscope how I make a user interface to make the stage move by pressing buttons?

    I have used LabView very little and am trying to write a program to control a microscope. I want to be able to give it commands such as to get the stage to move left, right, forward, back, and return to zero. I'm having trouble implementing the code into my block diagram. I've been reading LabView 8.6 tutorials for a couple of weeks and I'm still learning. What I know that  is that I need a event structure inside a while-loop for the user interface but I've been stuck.
    Thanks for any help! If you need me to try and provide more information please say so.
    Attachments:
    Button.vi ‏21 KB

    Alright so my serial port code should be inside a while loop unfortunately it doesn't work whenever I enter a command to move the stage. It sits there maybe I'm missing something.
    So let me give you an overview to what happens in my code, so the configure serial port is very crucial. The VISA Write writes the bytes to the port. The first VISA Write takes the string to write command. I connected the second VISA write to make it easier whenever I enter a command, the \r will iniate the command as a whole. Example L\r will move the stage to Left once, ending up at VISA Read then closing. All of this found in separate case structures.
    Now the user interface to control the the movement of the microscope is one of my issues, making several attempts to make it work yielded no results. My best work not the best but a attempt is attached, also one of the things with this I'm having trouble with is getting the button to talk to the stage. On previous buttons I worked on I could press the button and light up an LED on the front panel, I thought the same principle would relate to the movement of the stage, no such luck.
    I hope I cleared up some misconceptions on my part, I appreciate your patience.
    Attachments:
    OptiScan.vi ‏14 KB

  • JSON content - click to show another symbol on the stage

    Hi,
    Thanks to Zaxist I have a working code like the one below:
    $.getJSON("content.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                        var s = sym.createChildSymbol("template","content");
                        s.$("title").html(data[i].title);
                        s.$("description").html(data[i].description);
                        s.$("seira").html(data[i].seira);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')"});
                        s.$("imageholder").data('Large', data[i].largeimage);
                        s.$("imageholder").click("click", function(e){
                                                                sym.getComposition().getStage().$("finte").css({"background-image":"url("+$(this).data('L arge')+")"});
    Now, I am trying on the click function to show specific symbol on the stage, for example when click on the first item the symbol red will appear, if cliked the second item the (previous symbols that was appeared will be hided) and the new symbol blue will appear. An so on with all the other ellements that JSON files has.
    I tried this on the code, but nothing:
    $.getJSON("content.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                        var s = sym.createChildSymbol("template","content");
                        s.$("title").html(data[i].title);
                        s.$("description").html(data[i].description);
                        s.$("seira").html(data[i].seira);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')"});
                        s.$("imageholder").data('Large', data[i].largeimage);
                        s.$("imageholder").click("click", function(e){
                                                                sym.getComposition().getStage().$("finte").css({"background-image":"url("+$(this).data('L arge')+")"});
                                                                if (data[i]=3) {
                                                                                                                                                                                                                                                                sym.getComposition().getStage().$("red").show();
                                                                else {
                                                                sym.getComposition().getStage().$("red").hide();
                                                                if (data[i]=5) {
                                                                                                                                                                                                                                                                                                                             sym.getComposition().getStage().$("blue").show();
                                                                else {
                                                                sym.getComposition().getStage().$("blue").hide();
    Could you help me?
    Thanks in advanced!

    Zaxist please I need your help again.
    I have this:
    $.getJSON("images1.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                        var s = sym.getSymbol("base").createChildSymbol("template", "content");
                        s.element.attr('id', 'basara'+i)
                                            s.getSymbolElement().css({"background-size":"contain",
                                               "float": "left",
    "margin": "100 125px 125px 100",
    "clearboth":"{ clear: both; }"
                        s.$("description").html(data[i].description);
                        s.$("code").html(data[i].code);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')",
                                                                                                                                                                     "background-size":"cover"
                        s.$("imageholder").data('myIndex', i);
                                                                          s.$("imageholder").data('Large', data[i].image);
                         s.$("imageholder").click("click", function(e){
                                                                     if ($(this).data("myIndex") == 0){
    sym.getComposition().getStage().getSymbol('holders').$("holder1").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 1) {
    sym.getComposition().getStage().getSymbol('holders').$("holder1").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 2) {
    sym.getComposition().getStage().getSymbol('holders').$("holder1").css({"background-image": "url("+$(this).data('Large')+")"});
    $.getJSON("images2.json",
              function(data){
                        for(var i=0; i<data.length; i++){
                       var s = sym.getSymbol("podia").createChildSymbol("template", "contentpodia");
                                           s.getSymbolElement().css({"background-size":"contain",
                                               "float": "left"});
                        s.$("description").html(data[i].description);
                        s.$("code").html(data[i].code);
                        s.$("imageholder").css({"background-image":"url('"+data[i]. image+"')",
                                                                                                                                                                     "background-size":"cover"
                        s.$("imageholder").data('myIndex', i);
                                                                          s.$("imageholder").data('Large', data[i].image);
                         s.$("imageholder").click("click", function(e){
                                                                     if ($(this).data("myIndex") == 0){
    sym.getComposition().getStage().getSymbol('holders').$("holder2").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 1) {
    sym.getComposition().getStage().getSymbol('holders').$("holder2").css({"background-image": "url("+$(this).data('Large')+")"});
                            else if ($(this).data("myIndex") == 2) {
    sym.getComposition().getStage().getSymbol('holders').$("holder2").css({"background-image": "url("+$(this).data('Large')+")"});
    I want to import symbol podia inside to base to handle it by content2.
    I am writing this:
    var basewithpodia = sym.getSymbol("base").createChildSymbol("podia", "content2");
    it places the symbol inside, without the data of the JSON file.
    How can I make it to work?

  • OM: CLEARING THE PROCESS MESSAGES TABLES

    제품 : MFG_OM
    작성날짜 : 2004-10-11
    OM: CLEARING THE PROCESS MESSAGES TABLES
    ==========================================
    PURPOSE
    OM 모듈을 어느 기간 사용하다 보면 process messages table -
    OE_PROCESSING_MSGS_TL/OE_PROCESSING_MSGS - 에 많은 data가 쌓여 있는것을
    확인할 수 있다.
    이 tables의 size를 줄임으로써 system performance 향상도 기대할 수 있다.
    Explanation
    OE_PROCESSING_MSGS_TL table은 Order Entry concurreny problem이 실행되거
    나 User interface process가 실행될때 발생하는 processing messages를
    저장하는 table이다.
    아래의 3가지 방법중 하나를 이용하여 process messagea tables
    - OE_PROCESSING_MSGS_TL/OE_PROCESSING_MSGS -의 정보를 delete 할 수 있다.
    1.SQL을 이용하여 table을 truncate
    (OE_PROCESSING_MSGS_TL를 먼저 truncate 시켜야 함을 주의)
    경고: 만약 truncate 방법을 선택했다면, 위 두 tables에 있는 모든 정보를
    잃게 될 것이다.
    2.OM application의 Process Messages form을 이용.
    Delete 될 messages는 사용자의 query에 따른다.
    Process Messages form에서 delete 하고자 하는 messages range를 설정하여
    조회한 후, 그 query된 messages만 delete 할 수 있다.
    1) Navigation: Orders, Returns>Process Messages
    2) Messages source를 선택
    3) Query를 원하는 Messages Request ID range를 입력
    4) Query를 원하는 Messages의 Order Number range를 입력
    5) Query를 원하는 Messages의 Request Date range를 입력
    6) Query를 원하는 Messages의 Program Name을 선택
    7) 특정한 Workflow Activity를 가지고 있는 Workflow Activity를 선택
    WF activity는 Order의 actual stage를 참조한다.
    8) Query를 원하는 Message의 Order Type을 선택
    9) Attribute를 선택, Default는 null
    10) Customer Name or Number를 선택
    11) Requester를 선택
    12) Find button을 선택
    Process Messages window displays.
    13) Query된 모든 messages를 delete 하기 위새 'Delete All' button을
    click.
    3.SQL을 이용하여 특정 일자전의 모든 process messages를 delete.
    (OE_PROCESSING_MSGS_TL 의 data를 먼저 delete 함을 명심!!)
    위 1번의 truncate option을 이용하면, SQL statement는 어떤 messages를
    delete하는지 전혀 식별할 수가 없다.
    만약 특정 process에 관련된 messages만을 delete하길 원하면 아래의
    truncate option 2를 이용한다.
    아래는 sample script이며, creation date를 근간으로 delete한다.
    만약 오늘 날짜(dd-mon-yy)를 입력하면 script는 7일전의 messages만을
    delete 할 것이다.
    ====================================================
    DECLARE
    l_date DATE := to_date('&delete_date');
    BEGIN
    Delete from oe_processing_msgs_tl
    Where creation_date <= l_date - 7;
    Delete from oe_processing_msgs
    Where creation_date <= l_date - 7;
    Exception
    WHEN Others THEN
    Null;
    END;
    After executing this script commit and exit from sqlplus.
    =======================================================
    Note: 꼭 기억해야 할 것은 'Delete/Truncate' 작업시 'OE_PROCESSING_MSGS'
    data를 delete 전에 꼭 'OE_PROCESSING_MSGS_TL' data를 먼저 delete
    해야 한다는 것이다.
    Example
    Reference Documents
    Note 123150.1

    You can include PSA's in process chain and schedule deletion periodically.
    You can include process type 'Deletion of Requests from PSA / Deletion of Requests from the Change Log   ' in process chain . After EHP1 upgrade you can define pattern like 2lis* or 0* it will delete all the PSA's starting with 2lis or 0 data source .
    Ravi

  • You could say to me the stages to create this datasource?

    hello
    I have two ODS: ODS A and ODS B.
    I want to load data ODS A  by ODS B, I do not want to load  directly but i want using ODS B as datasource.
    You could say to me the stages to create this datasource?
    best regard

    Your requirement is not really clear. What do you want to achieve?
    As such, you can right click on the DSO, select Additional Functions -> Generate Export Datasource.

Maybe you are looking for

  • Whats the link between Migo ( Material Doc no ) & resp Accounting doc no

    In order to generate one development in MM. I need to know Link between Material Doc number ( MIGO ) transaction & Accounting document generated for that particular Material doc number which we browse thru Follow on Doc. In case the Number range for

  • Transfer iPhoto Events to Photo

    I have been asked by the Apple Applications App to upgrade from Yosemite 10.10.2 to 10.10.3. This update will install the new Photos App. I am concerned that I will loose my current system of filing my photos which is based upon filing all my photos

  • Search help enhancement - VA01

    Hello, I am trying to enhance standard search help on material field(RV45A-MABNR) on VA01 screen with my custom search help. Can someone please suggest which search help is being used by this material field? Thanks,

  • Unit of measure relation 1,000,000 to 1

    Hello Guys, In the material master data i have the requirement to add an alternative unit of measure. The relation is 1 MIU (mega international unit) = 1,000,000 IU The denominator accepts maximum 6 positions (=100,000). We dont want to use intermedi

  • I can't download iTunes at the moment! Help!?

    it says there's an error and that the webpage has either relocated or is down temporarily. Is anyone else experiencing this problem or is it my computer?