Search Results

Search found 111 results on 5 pages for 'dispatchevent'.

Page 4/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • doubt regarding carrying data in custom events using actionscript

    - by user267530
    Hi I am working on actionscript to generate a SWF dynamically using JSON data coming from an HTTP request. I receive the data on creationComplete and try to generate a tree like structure. I don’t create the whole tree at the same time. I create 2 levels, level 1 and level 2. My goal is to attach custom events on the panels which represent tree nodes. When users click the panels, it dispatches custom events and try to generate the next level. So, it goes like this : On creation complete - get JSON- create top tow levels - click on level 2- create the level 2 and level 3 - click on level 3- create level 3 and 4. …and so on and so on. I am attaching my code with this email. Please take a look at it and if you have any hints on how you would do this if you need to paint a tree having total level number = “n” where( 0 import com.iwobanas.effects.*; import flash.events.MouseEvent; import flash.filters.BitmapFilterQuality; import flash.filters.BitmapFilterType; import flash.filters.GradientGlowFilter; import mx.controls.Alert; private var roundedMask:Sprite; private var panel:NewPanel; public var oldPanelIds:Array = new Array(); public var pages:Array = new Array();//cleanup public var delPages:Array = new Array(); public function DrawPlaybook(pos:Number,title:String,chld:Object):void { panel = new NewPanel(chld); panel.title = title; panel.name=title; panel.width = 100; panel.height = 80; panel.x=pos+5; panel.y=40; // Define a gradient glow. var gradientGlow:GradientGlowFilter = new GradientGlowFilter(); gradientGlow.distance = 0; gradientGlow.angle = 45; gradientGlow.colors = [0xFFFFF0, 0xFFFFFF]; gradientGlow.alphas = [0, 1]; gradientGlow.ratios = [0, 255]; gradientGlow.blurX = 10; gradientGlow.blurY = 10; gradientGlow.strength = 2; gradientGlow.quality = BitmapFilterQuality.HIGH; gradientGlow.type = BitmapFilterType.OUTER; panel.filters =[gradientGlow]; this.rawChildren.addChild(panel); pages.push(panel); panel.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){onClickHandler(e,title,chld)}); this.addEventListener(CustomPageClickEvent.PANEL_CLICKED, function(e:CustomPageClickEvent){onCustomPanelClicked(e,title)}); } public function onClickHandler(e:MouseEvent,title:String,chld:Object):void { //var panel:Panel; for each(var stp1:NewPanel in pages){ if(stp1.title==title){ var eventObj:CustomPageClickEvent = new CustomPageClickEvent("panelClicked"); eventObj.panelClicked = stp1; dispatchEvent(eventObj); } } } private function onCustomPanelClicked(e:CustomPageClickEvent,title:String):void { //cleanup itself Alert.show("onCustomPanelClicked" + title); var panel:NewPanel; for each(var stp:NewPanel in pages){ startAnimation(e,stp); } if(title == e.panelClicked.title){ panel = new NewPanel(null); panel.title = title; panel.name=title; panel.width = 150; panel.height = 80; panel.x=100; panel.y=40; this.rawChildren.addChild(panel); // var slideRight:SlideRight = new SlideRight(); slideRight.target=panel; slideRight.duration=750; slideRight.showTarget=true; slideRight.play(); //draw the steps var jsonData = this.map.getValue(title); var posX:Number = 50; var posY:Number = 175; for each ( var pnl:NewPanel in pages){ pages.pop(); } for each ( var stp1:Object in jsonData.children){ //Alert.show("map step=" + stp.text ); panel = new NewPanel(null); panel.title = stp1.text; panel.name=stp1.id; panel.width = 100; panel.id=stp1.id; panel.height = 80; panel.x = posX; panel.y=posY; posX+=150; var s:String="hi" + stp1.text; panel.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){onChildClick(e,s);}); this.addEventListener(CustomPageClickEvent.PANEL_CLICKED, function(e:CustomPageClickEvent){onCustomPnlClicked(e)}); this.rawChildren.addChild(panel); // Alert.show("map step=" + this.getChildIndex(panel) ); // oldPanelIds.push(panel); pages.push(panel); //this.addEventListener(CustomPageClickEvent.PANEL_CLICKED, //function(e:CustomPageClickEvent){onCustomPanelClicked(e,title)}); var slide:SlideUp = new SlideUp(); slide.target=panel; slide.duration=1500; slide.showTarget=false; slide.play(); } } } public function onChildClick(e:MouseEvent,s:String):void { //var panel:Panel; //Alert.show(e.currentTarget.title); for each(var stp1:NewPanel in pages){ if(stp1.title==e.currentTarget.title){ var eventObj:CustomPageClickEvent = new CustomPageClickEvent("panelClicked"); eventObj.panelClicked = stp1; dispatchEvent(eventObj); } } } private function onCustomPnlClicked(e:CustomPageClickEvent):void { for each ( var pnl:NewPanel in pages){ pages.pop(); } //onCustomPanelClicked(e,e.currentTarget.title); //Alert.show("hi from cstm" + e.panelClicked.title); } private function fadePanel(event:Event,panel:NewPanel):void{ panel.alpha -= .005; if (panel.alpha <= 0){ //Alert.show(panel.title); panel.removeEventListener(Event.ENTER_FRAME, function(e:Event){fadePanel(e,panel);}); }; panel.title=""; } private function startAnimation(event:CustomPageClickEvent,panel:NewPanel):void{ panel.addEventListener(Event.ENTER_FRAME, function(e:Event){fadePanel(e,panel)}); } Thanks in advance. Palash

    Read the article

  • java.lang.ArrayIndexOutOfBoundsException

    - by thefonso
    Here is the code. import java.applet.Applet; import java.awt.Button; import java.awt.Color; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class GuessingGame extends Applet{ /** * */ private static final long serialVersionUID = 1L; private final int START_X = 20; private final int START_Y = 40; private final int ROWS = 4; private final int COLS = 4; private final int BOX_WIDTH = 20; private final int BOX_HEIGHT = 20; //this is used to keep track of boxes that have been matched. private boolean matchedBoxes[][]; //this is used to keep track of two boxes that have been clicked. private MaskableBox chosenBoxes[]; private MaskableBox boxes[][]; private Color boxColors[][]; private Button resetButton; public void init() { boxes = new MaskableBox[ROWS][COLS]; boxColors = new Color[ROWS][COLS]; resetButton = new Button("Reset Colors"); resetButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { randomizeColors(); buildBoxes(); repaint(); } }); add(resetButton); //separate building colors so we can add a button later //to re-randomize them. randomizeColors(); buildBoxes(); } public void paint(Graphics g) { for (int row =0; row < boxes.length; row ++) { for (int col = 0; col < boxes[row].length; col++) { if(boxes[row][col].isClicked()) { //boxes[row][col].setMaskColor(Color.black); //boxes[row][col].setMask(!boxes[row][col].isMask()); //boxes[row][col].setClicked(false); //} if (!matchedBoxes[row][col]) { gameLogic(boxes[row][col]); //boxes[row][col].draw(g); } } } } //loop through the boxes and draw them. for (int row = 0; row < boxes.length; row++) { for (int col = 0; col < boxes[row].length; col++) { boxes[row][col].draw(g); } } } public void gameLogic(MaskableBox box) { if ((chosenBoxes[0] != null)&&(chosenBoxes[1] != null)) { if(chosenBoxes[0].getBackColor() == chosenBoxes[1].getBackColor()) { for (int i=0; 0 <= chosenBoxes.length; ++i ) { for(int row = 0; row < boxes.length; row++) { for(int col = 0; col < boxes[row].length; col++) { if( boxes[row][col] == chosenBoxes[i] ) { System.out.println("boxes [row][col] == chosenBoxes[] at index: " + i ); matchedBoxes[row][col] = true; break; } } } } }else { chosenBoxes[0].setMask(true); chosenBoxes[1].setMask(true); } chosenBoxes = new MaskableBox[2]; }else { if (chosenBoxes[0] == null) { chosenBoxes[0] = box; chosenBoxes[0].setMask(false); return; }else{ if (chosenBoxes[1] == null) { chosenBoxes[1] = box; chosenBoxes[1].setMask(false); } } } } private void removeMouseListeners() { for(int row = 0; row < boxes.length; row ++) { for(int col = 0; col < boxes[row].length; col++) { removeMouseListener(boxes[row][col]); } } } private void buildBoxes() { // need to clear any chosen boxes when building new array. chosenBoxes = new MaskableBox[2]; // create a new matchedBoxes array matchedBoxes = new boolean [ROWS][COLS]; removeMouseListeners(); for(int row = 0; row < boxes.length; row++) { for(int col = 0; col < boxes[row].length; col++) { boxes[row][col] = new MaskableBox(START_X + col * BOX_WIDTH, START_Y + row * BOX_HEIGHT, BOX_WIDTH, BOX_HEIGHT, Color.gray, boxColors[row][col], true, true, this); addMouseListener(boxes[row][col]); } } } private void randomizeColors() { int[] chosenColors = {0,0,0,0,0,0,0,0}; Color[] availableColors = {Color.red, Color.blue, Color.green, Color.yellow, Color.cyan, Color.magenta, Color.pink, Color.orange }; for(int row = 0; row < boxes.length; row++) { for (int col = 0; col < boxes[row].length; col++) { for (;;) { int rnd = (int) (Math.random() * 8); if (chosenColors[rnd]< 2) { chosenColors[rnd]++; boxColors[row][col] = availableColors[rnd]; break; } } } } } } here is the second batch of code containing maskablebox import java.awt.Color; import java.awt.Container; import java.awt.Graphics; public class MaskableBox extends ClickableBox { private boolean mask; private Color maskColor; Container parent; public MaskableBox(int x, int y, int width, int height, Color borderColor, Color backColor, boolean drawBorder, boolean mask, Container parent ) { super(x, y, width, height, borderColor, backColor, drawBorder, parent); this.parent = parent; this.mask = mask; } public void draw(Graphics g) { if(mask=false) { super.draw(g); // setOldColor(g.getColor()); // g.setColor(maskColor); // g.fillRect(getX(),getY(),getWidth(), getHeight()); // if(isDrawBorder()) { // g.setColor(getBorderColor()); // g.drawRect(getX(),getY(),getWidth(),getHeight()); // } // g.setColor(getOldColor()); }else { if(mask=true) { //super.draw(g); setOldColor(g.getColor()); g.setColor(maskColor); g.fillRect(getX(),getY(),getWidth(), getHeight()); if(isDrawBorder()) { g.setColor(getBorderColor()); g.drawRect(getX(),getY(),getWidth(),getHeight()); } g.setColor(getOldColor()); } } } public boolean isMask() { return mask; } public void setMask(boolean mask) { this.mask = mask; } public Color getMaskColor() { return maskColor; } public void setMaskColor(Color maskColor) { this.maskColor = maskColor; } } I keep getting these error messages. I'm going nuts trying to figure this out. can anyone tell me what I'm doing wrong? boxes [row][col] == chosenBoxes[] at index: 0 boxes [row][col] == chosenBoxes[] at index: 1 Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 2 at GuessingGame.gameLogic(GuessingGame.java:77) at GuessingGame.paint(GuessingGame.java:55) at java.awt.Container.update(Container.java:1801) at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239) at sun.awt.RepaintArea.paint(RepaintArea.java:216) at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:306) at java.awt.Component.dispatchEventImpl(Component.java:4706) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Read the article

  • Testing movie with Flash IDE fails to load file from localhost

    - by davgothic
    Hi, I'm just wondering if anybody can help me with my simple but frustrating problem. I have created an SWF that loads an XML file from http://localhost/flash/Projects/MEL/Quiz/Quiz/bin/xml/quiz.xml, but I get this error when running the movie using Test Movie in the Flash IDE. Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://localhost/flash/Projects/MEL/Quiz/Quiz/bin/xml/quiz.xml at Main/loadConfig()[D:\www\webroot\flash\Projects\MEL\Quiz\Quiz\src\Main.as:126] at Main/configLoadError()[D:\www\webroot\flash\Projects\MEL\Quiz\Quiz\src\Main.as:143] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() The error I get if I handle the exception is: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/flash/Projects/MEL/Quiz/Quiz/bin/xml/quiz.xml"] Trouble is running the SWF in a browser locally does work, it only throws these errors in the Flash IDE. I have tried a adding wildcard crossdomain.xml file in my root web directory and setting the SWF publish properties for local playback security to Allow network only, but neither of these have solved my problem. I know Windows 7 handles localhost name resolution differently compared to previous versions of Windows but I have even added 127.0.0.1 localhost to my hosts file to no avail. Can anyone shed any light on this issue?

    Read the article

  • outofmemoryerror when running jar but not when running in netbeans/ apache poi

    - by Laughy
    I basically have a program that filters records from one excel file to another excel file using the apache poi. My program runs fine when it runs using netbeans. However, upon doing a clean and build and double clicking the .jar file inside the dist folder, it runs for very long( too long!) and gives me the following error( that I got by running the program from command prompt ). Is there any work around for it? I have already increase the heap size to be -Xms1500m inside netbeans before cleaning and building. Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at org.apache.xmlbeans.impl.store.Saver$TextSaver.resize(Saver.java:1592) at org.apache.xmlbeans.impl.store.Saver$TextSaver.preEmit(Saver.java:1223) at org.apache.xmlbeans.impl.store.Saver$TextSaver.emit(Saver.java:1144) at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitElement(Saver.java:926) at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:456) at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307) at org.apache.xmlbeans.impl.store.Saver$TextSaver.saveToString(Saver.java:1727) at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546) at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436) at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1455) at org.apache.poi.xssf.model.SharedStringsTable.getKey(SharedStringsTable.java:130) at org.apache.poi.xssf.model.SharedStringsTable.addEntry(SharedStringsTable.java:176) at org.apache.poi.xssf.usermodel.XSSFCell.setCellType(XSSFCell.java:755) at equity.EquityFrame_Updated.copyRowsFromOldToNew(EquityFrame_Updated.java:646) at equity.EquityFrame_Updated.init(EquityFrame_Updated.java:133) at equity.EquityFrame_Updated.createAndShowGUI(EquityFrame_Updated.java:71) at equity.EquityFrame_Updated.<init>(EquityFrame_Updated.java:50) at equity.FileOpener.generateButtonPressed(FileOpener.java:160) at equity.FileOpener.access$100(FileOpener.java:17) at equity.FileOpener$2.actionPerformed(FileOpener.java:61) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source)

    Read the article

  • Flex 3.5.0; Update ComboBox display list upon dataprovider change

    - by Gabriel Poama-Neagra
    Hello, I have two related ComboBoxes ( continents, and countries ). When the continents ComboBox changes I request a XML from a certain URL. When I receive that XML i change the DataProvider for the countries ComboBox, like this: public function displayCountryArray( items:XMLList ):void { this.resellersCountryLoader.alpha = 0; this.resellersCountry.dataProvider = items; this.resellersCountry.dispatchEvent( new ListEvent( ListEvent.CHANGE ) ); } I dispatch the ListEvent.CHANGE because I use it to change another ComboBox so please ignore that (and the 1st line ). So, my problem is this: I select "ASIA" from the first continents, then the combobox DATA get's updated ( I can see that because the first ITEM is an item with the label '23 countries' ). I click the combo then I can see the countries. NOW, I select "Africa", the first item is displayed, with the ComboBox being closed, then when I click it, the countries are still the ones from Asia. Anyway, if I click an Item in the list, then the list updates correctly, and also, it has the correct info ( as I said it affects other ComboBoxes ). SO the only problem is that the display list does not get updated. In this function I tried these approaches Converting XMLList to XMLCollection and even ArrayCollection Adding this.resellersCountry.invalidateDisplayList(); Triggering events like DATA_CHANGE and UPDATE_COMPLETE I know they don't make much sense, but I got a little desperate. Please note that when I used 3.0.0 SDK this did not happen. Sorry if I'm stupid, but the flex events are killing me.

    Read the article

  • Why a Swing app stops my Java servlet ?

    - by Frank
    I have a Swing runnable app which updates messages, then I have a Java servlet that gets messages from Paypal IPN (Instant Payment Notification), when the servlet starts up, in the init(), I starts the Swing runnable app which opens a desktop window, but 30 minutes later an error in the Swing caused the servlet to stop, how can that happen ? Because the runnable is running on it's own thread, servlet started that thread, why an error in that thread will cause the servlet to stop ? public class License_Manager extends JPanel implements Runnable { License_Manager() { Do_GUI(); ... start(); } public static void main(String[] args) { // Schedule a job for the event-dispatching thread : creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { Create_And_Show_GUI(); } }); } } public class PayPal_Servlet extends HttpServlet { public void init(ServletConfig config) throws ServletException { super.init(config); License_Manager.main(null); } protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException { } } And besides the error don't even have anything to do with my code, it looks like this : Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 17 = 0 at java.util.Vector.elementAt(Vector.java:427) at javax.swing.DefaultListModel.getElementAt(DefaultListModel.java:70) at javax.swing.plaf.basic.BasicListUI.paintCell(BasicListUI.java:191) at javax.swing.plaf.basic.BasicListUI.paintImpl(BasicListUI.java:304) at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:227) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:143) at javax.swing.JComponent.paintComponent(JComponent.java:763) at javax.swing.JComponent.paint(JComponent.java:1029) at javax.swing.JComponent.paintChildren(JComponent.java:864) at javax.swing.JComponent.paint(JComponent.java:1038) at javax.swing.JViewport.paint(JViewport.java:747) at javax.swing.JComponent.paintChildren(JComponent.java:864) at javax.swing.JComponent.paint(JComponent.java:1038) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124) at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278) at javax.swing.RepaintManager.paint(RepaintManager.java:1220) at javax.swing.JComponent._paintImmediately(JComponent.java:5072) at javax.swing.JComponent.paintImmediately(JComponent.java:4882) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714) at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Read the article

  • Problem using Flash Components in multiple SWC files

    - by Ken Dunnington
    [Edit: Short version - how do you properly handle namespace collisions in SWC files if one SWC has fewer classes from that namespace than another?] I have a rather large Flash application which I'm building in Flash Builder (because coding/debugging in the Flash IDE is... not good) and I've got a ton of external SWC files which I'm linking in to my application. This has worked well so far - the file size is on the large side, but it's a lot simpler than loading in SWFs, especially since I am extending most of the classes in each SWC and adding custom code that way (it's a very design-heavy app.) The problem I'm having is when I have Flash Components, like ComboBox or TextInput, in more than one SWC. Whichever SWC was compiled last will work fine, but the others will fail with errors like the following: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@1f21adc1 to fl.controls.TextInput. at flash.display::Sprite/constructChildren() at flash.display::Sprite() at flash.display::MovieClip() at com.company.design.login::LoginForm() at com.company.view::Login()[/Users/ken/Workspace/src/com/company/view/Login.as:22] at com.company.view::Main/showLogin()[/Users/ken/Workspace/src/com/company/view/Main.as:209] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.company.view::Navigation/handleUIClick()[/Users/ken/Workspace/src/com/company/view/Navigation.as:88] I've been researching components, ComponentShim, etc. but I'm running up against a brick wall. I thought it might be the fact that some of the components had their skins modified in the source FLA, so I tried replacing them with the default skins, but that didn't seem to help. How can I ensure that I have the components imported and available to all my classes, yet still be able to skin them and include them in my various FLAs? (I am never creating new instances of them, they are all laid out by my designer.)

    Read the article

  • NoSuchMethod exception when using scala Regex class... confused...

    - by hbatista
    Hi there, I have a simple Scala project that runs without any problems inside Eclipse, however, when packaged into a .jar I receive this exception when running it: Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: scala.util.matching.Regex.replaceAllIn(Ljava/lang/CharSequence;Lscala/Function1;)Ljava/lang/String; What is going on here?... The code line in question, and the full stack are below. This is the offending line: "alt=\"[^>]+\">".r.replaceAllIn(inputStr, {_.replace(">", "/>")}) Full stack: Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: scala.util.matching.Regex.replaceAllIn(Ljava/lang/CharSequence;Lscala/Function1;)Ljava/lang/String; at com.inosat.fuel.FuelStationDgge.fixhtml(FuelStationDgge.scala:40) at com.inosat.fuel.FuelStationDgge.setDetails(FuelStationDgge.scala:82) at com.inosat.fuel.DggeParser$$anon$1.propertyChange(DggeParser.scala:49) at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at org.jdesktop.beans.AbstractBean.firePropertyChange(AbstractBean.java:302) at org.jdesktop.http.async.AsyncHttpRequest.setReadyState(AsyncHttpRequest.java:705) at org.jdesktop.http.async.AsyncHttpRequest.access$600(AsyncHttpRequest.java:79) at org.jdesktop.http.async.AsyncHttpRequest$AsyncWorker.done(AsyncHttpRequest.java:831) at javax.swing.SwingWorker$5.run(Unknown Source) at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source) at sun.swing.AccumulativeRunnable.run(Unknown Source) at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source) at javax.swing.Timer.fireActionPerformed(Unknown Source) at javax.swing.Timer$DoPostEvent.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

    Read the article

  • Flash Security Error Accessing URL with crossdomain.xml

    - by user163757
    Hello, I recently deployed a Flash application to a server, and am now experiencing errors when making HTTPService requests. I have put what I believe to be the most permissive crossdomain.xml possible in the wwwroot folder, and still get the errors. Interestingly enough, the error only seems to occur when the request is made from a direct user interaction (i.e. button click). The application makes other requests that are initiated by other means(i.e creationComplete) , and they seem to work as expected. Anyone see anything wrong with the crossdomain.xml, or have any other suggestions? ERROR MESSAGE [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal%3A%3AfaultHandler() at mx.rpc::Responder/fault() at mx.rpc::AsyncRequest/fault() at DirectHTTPMessageResponder/securityErrorHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/redirectEvent() <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="all" /> <allow-access-from domain="*" secure="false" /> <allow-http-request-headers-from domain="*" headers="*" secure="false" /> </cross-domain-policy>

    Read the article

  • Java Runtime Exception

    - by ikurtz
    when i run my application i get the following error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.text.FlowView$FlowStrategy.layoutRow(FlowView.java:546) at javax.swing.text.FlowView$FlowStrategy.layout(FlowView.java:460) at javax.swing.text.FlowView.layout(FlowView.java:184) at javax.swing.text.BoxView.setSize(BoxView.java:380) at javax.swing.text.BoxView.updateChildSizes(BoxView.java:349) at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:331) at javax.swing.text.BoxView.layout(BoxView.java:691) at javax.swing.text.BoxView.setSize(BoxView.java:380) at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1702) at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1034) at javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1291) at javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1270) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) as the error does not mention any of my classes, how would i go about in finding what is causing this? if i try: public void notifyChatMessage(String message){...} the error goes away. but if i try: public void notifyChatMessage(Object message){...} the error is reported. please advise.

    Read the article

  • Java Applet in Firefox

    - by prakash
    Hi All, I am facing a weird problem in Testing server while using applet (using embed tag) in my ASP.NET MVC application Applet works fine locally in both browsers IE and Firefox but when deployed to Testing server its throwing below exception for Firefox only (IE works fine). Please help me out in this basic: exception: javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found. java.lang.RuntimeException: javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:772) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471) at org.apache.log4j.LogManager.<clinit>(LogManager.java:125) at org.apache.log4j.Logger.getLogger(Logger.java:105) at com.goldleaf.scanner.Logger.<init>(Unknown Source) at com.goldleaf.scanner.Logger.<init>(Unknown Source) at com.goldleaf.scanner.Logger$LoggerHolder.<clinit>(Unknown Source) at com.goldleaf.scanner.Logger.getInstance(Unknown Source) at com.goldleaf.scanner.ScannerApplet.<init>(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Exception: java.lang.RuntimeException: javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found Ignored exception: java.lang.RuntimeException: javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found basic: Starting applet teardown basic: Finished applet teardown

    Read the article

  • error while loadin applet in web application

    - by pallavi
    I want to run my applet on web application, but i got some error which i mentioned below please help me to get out of this problem ============================================================================================= Java Plug-in 1.7.0 Using JRE version 1.7.0-ea-b116 Java HotSpot(TM) Client VM User home directory = C:\Users\HONEY c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to java.lang.RuntimeException: java.lang.NoClassDefFoundError: mp3$1 at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: mp3$1 at mp3.(mp3.java:93) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: mp3$1 at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 16 more Caused by: java.io.IOException: open HTTP connection failed:http://viscous10.webng.com/mp3/mp3$1.class at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 21 more Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: mp3$1 ========================================================================================== but it happens only if i run applet with events and in simple applet i never occurred thanx

    Read the article

  • call a custom event from an item renderer in flex 4

    - by john
    I have a Renderer: [Event(name="addToCart",type="event.ProductEvent")] import mx.collections.ArrayCollection; protected function button1_clickHandler(event:MouseEvent):void { var eventObj:ProductEvent=new ProductEvent("addToCart",data.price,data.descript); dispatchEvent(eventObj); } ]]> <s:Label text="{data.descript}"/> <mx:Image source="{data.url}" width="50" height="50" width.hovered="100" height.hovered="100"/> <s:Label text="{data.price}"/> <s:Button includeIn="hovered" click="button1_clickHandler(event)" label="buy"/> and the custom event class: package events { import flash.events.Event; [Bindable] public class ProductEvent extends Event { public var price:String; public var descript:String; public function ProductEvent(type:String,price:String, descript:String) { super(type); this.price=price; this.descript=descript; } override public function clone():Event { return new ProductEvent(type,price,descript); } } } but a cannot call that event in : any ideas? thanks

    Read the article

  • application-context.xml problem for Spring ActionScript

    - by jiri
    content of The application-content.xml is <?xml version="1.0" encoding="utf-8"?> <objects xmlns="http://www.springactionscript.org/schema/objects" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springactionscript.org/schema/objects http://www.springactionscript.org/schema/objects/spring-actionscript-objects-1.0.xsd"> <property file="strings.properties" /> <object id="string1" class="String"/> <object id="string2" class="String"/> <object id="nlslzf" class="com.sgb.model.MyClass"/> </objects> content of strings.properties is: s1=Firststring s2=Secondstring but error: Main Thread (Suspended: Error: An object definition for 'string1' was not found.) org.springextensions.actionscript.ioc.factory.support::AbstractObjectFactory/getObject SpringActionScript/test SpringActionScript/onCreationComplete SpringActionScript/___SpringActionScript_Application1_creationComplete flash.events::EventDispatcher/dispatchEventFunction [no source] mx.core::UIComponent/dispatchEvent mx.core::UIComponent/set initialized mx.managers::LayoutManager/doPhasedInstantiation Function/http://adobe.com/AS3/2006/builtin::apply [no source] mx.core::UIComponent/callLaterDispatcher2 mx.core::UIComponent/callLaterDispatcher2 mx.core::UIComponent/callLaterDispatcher i can run normal if removed the '' why it is? springactionscript bug?

    Read the article

  • MXML composite canvas component initialization error

    - by mkorpela
    I'm getting an odd error from my composite canvas component: An ActionScript error has occurred: Error: null at mx.core::Container/initialize()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\Container.as:2560] at -REMOVED THIS FOR STACK OVERFLOW-.view::EditableCanvas/initialize()[.../view/EditableCanvas .... It seems to be related to the fact that my composite component has a child and I'm trying to add one in the place I'm using the component. So how can I do this correctly? Component code looks like this (EditableCanvas.mxml): <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="{init()}"> <mx:Script> <![CDATA[ private var _editable:Boolean; public function set editable(edit:Boolean):void { _editable = edit; } private function init():void { if(_editable){ addEventListener(MouseEvent.MOUSE_OVER, showEdit); addEventListener(MouseEvent.MOUSE_OUT, hideEdit); } } private function showEdit(event:Event):void { editTextImage.visible = true; } private function hideEdit(event:Event):void { editTextImage.visible = false; } ]]> </mx:Script> <mx:Image id="editTextImage" source="@Embed('/../assets/icons/small/process.png')" click="{dispatchEvent(EditPoiEvent.text())}" visible="false"/> </mx:Canvas> The code that is using the code looks like this: <view:EditableCanvas width="290" height="120" backgroundColor="#FFFFFF" horizontalScrollPolicy="off" borderStyle="solid" cornerRadius="3" editable="{_editable}"> <mx:Text id="textContentBox" width="270" fontFamily="nautics" fontSize="12" text="{_text}"/> </view:EditableCanvas>

    Read the article

  • event flow in action script 3

    - by Shay
    i try to dispatch a custom event from some component on the stage and i register other component to listen to it but the other component doesn't get the event here is my code what do i miss public class Main extends MovieClip //main document class { var compSource:Game; var compMenu:Menu; public function Main() { compSource = new Game; compMenu = new Menu(); var mc:MovieClip = new MovieClip(); addChild(mc); mc.addChild(compSource); // the source of the event - event dispatch when clicked btn mc.addChild(compMenu); //in init of that Movie clip it add listener to the compSource events } } public class Game extends MovieClip { public function Game() { btn.addEventListener(MouseEvent.CLICK, onFinishGame); } private function onFinishGame(e:MouseEvent):void { var score:Number = Math.random() * 100 + 1; dispatchEvent(new ScoreChanged(score)); } } public class Menu extends MovieClip { //TextField score public function Menu() { addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, init); //on init add listener to event ScoreChanged addEventListener(ScoreChanged.SCORE_GAIN, updateScore); } public function updateScore(e:ScoreChanged):void { //it never gets here! tScore.text = String(e._score); } } public class ScoreChanged extends Event { public static const SCORE_GAIN:String = "SCORE_GAIN"; public var _score:Number; public function ScoreChanged( score:Number ) { trace("new score"); super( SCORE_GAIN, true); _score = score; } } I don't want to write in Main compSource.addEventListener(ScoreChanged.SCORE_GAIN, compMenu.updateScore); cause i dont want the the compSource will need to know about compMenu its compMenu responsibility to know to what events it needs to listen.... any suggestions? Thanks!

    Read the article

  • Double Click and Resize on an Ipad

    - by Luke
    Thanks to the great post at OranLooney.com I was able to get a java/icefaces web-app to resize nicely on the ipad, however the code provided for double click doesn't seem to work without further customization. Has anybody had any experience with getting this to work? there seems to be little documentation on google. the donnothing(); in the window.orientationchange is there as it seems sometimes without it the resize will (sometimes) not work // a function to parse the user agent string; useful for // detecting lots of browsers, not just the iPad. function checkUserAgent(vs) { var pattern = new RegExp(vs, 'i'); return !!pattern.test(navigator.userAgent); } if ( checkUserAgent('iPad') ) { // iPad specific stuff here window.onorientationchange = function() { donnothing(); }; document.body.addEventListener('touchstart', function(e) { touch = e.touches[0]; if ( !touch ) return; var me = document.createEvent("MouseEvents"); me.initMouseEvent('dblclick', true, true, window, 1, // detail / mouse click count touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, // key modifiers 0, // primary mouse button null // related target not used for dblclick event ); touch.target.dispatchEvent(me); }); }

    Read the article

  • Multiple dispatching issue

    - by user1440263
    I try to be synthetic: I'm dispatching an event from a MovieClip (customized symbol in library) this way: public function _onMouseDown(e:MouseEvent){ var obj = {targetClips:["tondo"],functionString:"testFF"}; dispatchEvent(new BridgeEvent(BridgeEvent.BRIDGE_DATA,obj)); } The BridgeEvent class is the following: package events { import flash.events.EventDispatcher; import flash.events.Event; public class BridgeEvent extends Event { public static const BRIDGE_DATA:String = "BridgeData"; public var data:*; public function BridgeEvent(type:String, data:*) { this.data = data; super(type, true); } } } The document class listens to the event this way: addEventListener(BridgeEvent.BRIDGE_DATA,eventSwitcher); In eventSwitcher method I have a simple trace("received"). What happens: when I click the MovieClip the trace action gets duplicated and the output window writes many "received" (even if the click is only one). What happens? How do I prevent this behaviour? What is causing this? Any help is appreciated. [SOLVED] I'm sorry, you will not believe this. A colleague, to make me a joke, converted the MOUSE_DOWN handler to MOUSE_OVER.

    Read the article

  • Am I doing AS3 reference cleanup correctly?

    - by Ólafur Waage
    In one frame of my fla file (let's call it frame 2), I load a few xml files, then send that data into a class that is initialized in that frame, this class creates a few timers and listeners. Then when this class is done doing it's work. I call a dispatchEvent and move to frame 3. This frame does some things as well, it's initialized and creates a few event listeners and timers. When it's done, I move to frame 2 again. This is supposed to repeat as often as I need so I need to clean up the references correctly and I'm wondering if I'm doing it correctly. For sprites I do this. world.removeChild(Background); // world is the parent stage Background = null; For instances of other classes I do this. Players[i].cleanUp(world); // do any cleanup within the instanced class world.removeChild(PlayersSelect[i]); For event listeners I do this. if(Background != null) { Background.removeEventListener(MouseEvent.CLICK, deSelectPlayer); } For timers I do this. if(Timeout != null) { Timeout.stop(); Timeout.removeEventListener(TimerEvent.TIMER, queueHandler); Timeout.removeEventListener(TimerEvent.TIMER_COMPLETE, queueCompleted); Timeout = null; } And for library images I do this if(_libImage!= null) { s.removeChild(Images._libImage); // s is the stage _libImage= null; } And for the class itself in the main timeline, I do this Frame2.removeEventListener("Done", IAmDone); Frame2.cleanUp(); // the cleanup() does all the stuff above Frame2= null; Even if I do all this, when I get to frame 2 for the 2nd time, it runs for 1-2 seconds and then I get a lot of null reference errors because the cleanup function is called prematurely. Am I doing the cleanup correctly? What can cause events to fire prematurely?

    Read the article

  • How do I force all Tree itemrenderers to refresh?

    - by Richard Haven
    I have item renderers in an mx.controls.Tree that I need to refresh on demand. I have code in the updateDisplayList that fires for only some of the visible nodes no matter what I do. I've tried triggering a change that they should all be listening for; I have tried clearing and resetting the dataProvider and the itemRenderer properties. private function forceCategoryTreeRefresh(event : Event = null) : void { trace("forceCategoryTreeRefresh"); var prevDataProvider : Object = CategoryTree.dataProvider; CategoryTree.dataProvider = null; CategoryTree.validateNow(); CategoryTree.dataProvider = prevDataProvider; var prevItemRenderer : IFactory = CategoryTree.itemRenderer; CategoryTree.itemRenderer = null; CategoryTree.itemRenderer = prevItemRenderer as IFactory; _categoriesChangeDispatcher.dispatchEvent(new Event(Event.CHANGE)); } The nodes refresh properly when I scroll them into view (e.g. the .data gets set), but I cannot force the ones that already exist to refresh or reset themselves. Any ideas?

    Read the article

  • Rails 3: Link_to :remote => true with JQuery?

    - by Derek
    Question update: I have figured out that importing JQuery (even without using it at all) is causing :remote => true to not work properly. I get the following error in the Chrome console: Uncaught TypeError: Object [object Object] has no method 'dispatchEvent' (prototype.js:5653) And when the link is clicked, it throws the same error again before redirecting. Responder.erb.html <ul> <% @choices.each_with_index do |choice, index| %> <li><%= link_to choice, { :action => "submit_response", :id => @id, :response => index }, :remote => true %></li> <% end %> </ul> Example generated HTML: <ul> <li><a href="/poller/submit_response/yni?response=0" data-remote="true">True</a></li> <li><a href="/poller/submit_response/yni?response=1" data-remote="true">False</a></li> </ul>

    Read the article

  • How to best manage multi-frame MovieClips with classes?

    - by Arms
    After switching to AS3, I've been having a hell of a time figuring out the best way to manage MovieClips that have UI elements spread across multiple frames with a single class. An example that I am working on now is a simple email form. I have a MovieClip with two frames: the 1st frame has the form elements (text inputs, submit button) the 2nd frame has a "thank you" message and a button to go back to the first frame (to send another email) In the library I have linked the MovieClip to a custom class (Emailer). My immediate problem is how do I assign a MouseEvent.CLICK event to the button on the 2nd frame? I should note at this point that I am trying to avoid putting code on the timeline (except for stop() calls). This is how I am 'solving' the problem now: Emailer registers an event listener for a frame change ( addEventListener("frame 2", onFrameChange) ) On the 2nd frame of the MovieClip I am calling dispatchEvent(new Event("frame 2")); (I would prefer to not have this code on the frame, but I don't know what else to do) My two complaints with this method are that, first I have calls to addEventListener spread out across different class methods (I would rather have all UI event listeners registered in one method), and second that I have to dispatch those custom "onFrameChange" events. The second complaint grows exponentially for MovieClips that have more than just 2 frames. My so called solution feels makes me feel dirty and makes my brain hurt. I am looking for any advice on what to do differently. Perhaps there's a design pattern I should be looking at? Should I swallow my pride and write timeline code even though the rest of my application is written in class files (and I abhor the Flash IDE code editor)? I absolutely LOVE the event system, and have no problem coding applications with it, but I feel like I'm stuck thinking in terms of AS2 when working with mutl-frame movieclips and code. Any and all help would be greatly appreciated.

    Read the article

  • Jquery + Prototype Question

    - by mikeyhill
    I recently inherited a site which is botched in all sorts of ways. I'm more of a php guy and initially the js was working just fine. I made no changes to the javascript or the any of the include files but after making a few content edits I'm getting errors from firebug. a.dispatchEvent is not a function emptyFunction()protot...ects.js (line 2) emptyFunction()protot...ects.js (line 2) fireContentLoadedEvent()protot...ects.js (line 2) [Break on this error] var Prototype={Version:'1.6.0.2',Brows...pe,Enumerable);Element.addMethods(); protot...ects.js (line 2) this.m_eTarget.setStyle is not a function [Break on this error] this.m_eTarget.setStyle( { position: 'relative', overflow:'hidden'} ); protot...ects.js (line 43) uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: js/prototype_effects.js :: anonymous :: line 2" data: no] Googling around I found several posts that sometimes jquery+prototype don't play well and rearranging the scripts could fix this issue, however being that I didn't touch these sections I'm not sure where I even need to begin to debug. The previous developer incorporated a head.inc file which loads up prototype, scriptaculous and then many of the pages are in a sub-template loading up jquery for functions like lightbox. The site is temp housed at http://dawn.mikeyhill.com Any help is appreciated.

    Read the article

  • Event-based interaction between two custom classes

    - by Antenka
    Hello everybody. I have such problem: I have 2 custom components, which have their own nesting hierarchy ... One is container for another. I have to "familiarize them" with each other. The way I'm trying to achieve that is using global events (one side is firing and the other one is catching): Application.application.addEventListener("Hello", function (data:Event):void{ // .. some actions }); //and Application.application.dispatchEvent(new Event(Hello)); Everything is pretty good, but there's one thingy .. when I'm trying to catch the event, I can't access the class, who is catching it. E.g.: Container fires the event. Child caughts it. Then should be created the connection between container and it's child. BUT, the only thing I could acheive is passing a reference to the Container in the DynamicEvent. Is there any chance that I could access the child at the event-handler function. Or maybe there's more elegant way to solve this problem ... Any help would be greately appreciated :)

    Read the article

  • GWT Javascript Exception in Hosted Mode: Result of expression 'doc.getBoxObjectFor' [undefined] is

    - by holmes
    Anyone ever seen this exception? I'm running in hosted mode on GWT 1.6.4 on a mac. I'm using the AutoSuggest and it's throwing this exception trying to show the popup. It works fine in compiled mode, but obviously hosted mode is rather important. [ERROR] Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (TypeError): Result of expression 'doc.getBoxObjectFor' [undefined] is not a function. line: 71 sourceId: 1152617088 sourceURL: jar:file:/Users/holmes/.m2/repository/com/google/gwt/gwt-user/1.6.4/gwt-user-1.6.4.jar!/com/google/gwt/dom/client/DOMImplMozillaOld.java expressionBeginOffset: 288 expressionCaretOffset: 307 expressionEndOffset: 313 at com.google.gwt.dom.client.DOMImplMozillaOld.getAbsoluteLeftImpl(Native Method) at com.google.gwt.dom.client.DOMImplMozillaOld.getAbsoluteLeft(DOMImplMozillaOld.java:29) at com.google.gwt.dom.client.Element$.getAbsoluteLeft$(Element.java:86) at com.google.gwt.user.client.DOM.getAbsoluteLeft(DOM.java:646) at com.google.gwt.user.client.ui.UIObject.getAbsoluteLeft(UIObject.java:487) at com.google.gwt.user.client.ui.PopupPanel.position(PopupPanel.java:1015) at com.google.gwt.user.client.ui.PopupPanel.access$5(PopupPanel.java:958) at com.google.gwt.user.client.ui.PopupPanel$1.setPosition(PopupPanel.java:811) at com.google.gwt.user.client.ui.PopupPanel.setPopupPositionAndShow(PopupPanel.java:700) at com.google.gwt.user.client.ui.PopupPanel.showRelativeTo(PopupPanel.java:809) at com.google.gwt.user.client.ui.SuggestBox.showSuggestions(SuggestBox.java:768) at com.google.gwt.user.client.ui.SuggestBox.access$3(SuggestBox.java:738) at com.google.gwt.user.client.ui.SuggestBox$1.onSuggestionsReady(SuggestBox.java:281) at com.google.gwt.user.client.ui.MultiWordSuggestOracle.requestSuggestions(MultiWordSuggestOracle.java:225) at com.google.gwt.user.client.ui.SuggestBox.showSuggestions(SuggestBox.java:640) at com.google.gwt.user.client.ui.SuggestBox.refreshSuggestions(SuggestBox.java:713) at com.google.gwt.user.client.ui.SuggestBox.access$6(SuggestBox.java:705) at com.google.gwt.user.client.ui.SuggestBox$1TextBoxEvents.onKeyUp(SuggestBox.java:678) at com.google.gwt.event.dom.client.KeyUpEvent.dispatch(KeyUpEvent.java:54) at com.google.gwt.event.dom.client.KeyUpEvent.dispatch(KeyUpEvent.java:1) at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65) at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178) at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:52) at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116) at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:90) at com.google.gwt.user.client.ui.TextBoxBase.onBrowserEvent(TextBoxBase.java:193) at com.google.gwt.user.client.ui.Composite.onBrowserEvent(Composite.java:54) at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320) at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299) at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >