Search Results

Search found 908 results on 37 pages for 'as3'.

Page 13/37 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Retrieve Flash file post in ASP.NET

    - by Quandary
    Question: In ASP.NET, I retrieve a JPEG-file as Flash post data like this Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest context.Response.ContentType = "text/plain" ' Retrieve a bytearray from the post buffer Dim myBuffer As Byte() = context.Request.BinaryRead(Convert.ToInt32(context.Request.InputStream.Length)) System.IO.File.WriteAllBytes("c:\temp\test.jpg", myBuffer) End Sub In Flash, I send it to an asp.net handler like this var jpgSource:BitmapData = cPrint.TakeSnapshot(MovieClip(cGlobals.ccPlanZoomView)); var bmpThisBitmap:Bitmap = new Bitmap(jpgSource); var nQuality:Number = 100; var jpgEncoder:JPGEncoder = new JPGEncoder(nQuality); var jpgStream:ByteArray = jpgEncoder.encode(jpgSource); var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream"); // Make sure to use the correct path to jpg_encoder_download.php var strFileName:String="test.jpg"; var jpgURLRequest:URLRequest = new URLRequest("http://localhost/raumplaner_new/raumplaner_new/cgi-bin/SavePDF.ashx"); //var scriptVars:URLVariables = new URLVariables(); //scriptVars.fn = strFileName; //var myarr:Array= new Array(); //myarr.push(jpgStream); //scriptVars.Files = myarr; jpgURLRequest.requestHeaders.push(header); jpgURLRequest.method = URLRequestMethod.POST; //jpgURLRequest.data = scriptVars; jpgURLRequest.data = jpgStream; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.BINARY; loader.load(jpgURLRequest); It works but I want to send a few additional variables along, via scriptVars (commented out here). How do I retrieve the JPEG file in that case ? Because if I use parameters, there is no more BinaryRead... Aspecially, how would I read an array of jpeg files (several files) ?

    Read the article

  • Some question of object property name in Actionscript3.

    - by unsouled
    A.as package { public class A { public static var someObject:Object = { (B.SOME_CONST): { value: 10 } }; } } B.as package { public class B { public static const SOME_CONST:String = "someStringConst"; } } And this is test code. var obj:Object = A.someObject; trace(obj.hasOwnProperty(B.SOME_CONST)); trace(obj.hasOwnProperty("someStringConst")); trace(obj.hasOwnProperty("SOME_CONST")); I expected that result will be true, true, false but real result is false, false, true. Why?

    Read the article

  • as3 swc component preview through code

    - by David
    I am developing an as3 swc-based component that populates its contents entirely through actionscript in the constructor (e.g. sprite.graphics.lineTo...). When I drag the component onto the stage, it is empty. If I export my movie, everything works perfectly, but I also need the live preview to work. I could get around this with a placeholder graphic, but I would much rather leave it purely as code. Is there any way to get around this? Thanks, David.

    Read the article

  • AS3 Event Bubbling outside of the Scenegraph/DisplayList

    - by Brian Heylin
    Hi just wondering if it is possible to take advantage of event bubbling in non display list classes in AS3. For example in the model of an application where there is a City class that contains many Cars. What methods are there to attach an event listener to a City object and receive events that bubble up from the child Cars. To clarify The City and Car objects are not part of the display list, they are not DisplayObjects. So can bubbling be implemented outside of the display list somehow? As far as I know, this is not possible without manually attaching event listeners to each Car object and re dispatching the event from the City object. Anyone else have a cleaner solution?

    Read the article

  • Dynamic Google Maps API InfoWindow HTML Content

    - by Peter Hanneman
    I am working in Flash Builder 4 with Google Map's ActionScript API. I have created a map, loaded some custom markers onto it and added some MouseEvent listeners to each marker. The trouble comes when I load an InfoWindow panel. I want to dynamically set the htmlContent based off of information stored in a database. The trouble is that this information can change every couple of seconds and each marker has a unique data set so I can not statically set it at the time I actually create the markers. I have a method that will every minute or so load all of the records from my database into an Object variable. Everything I need to display in the htmlContent is contained in this object under a unique identifier. The basic crux of the problem is that there is no way for me to uniquely identify an info window, so I can not determine what information to pull into the panel. marker.addEventListener(MapMouseEvent.ROLL_OVER, function(e:MapMouseEvent):void { showInfoWindow(e.latLng) }, false, 0, false); That is my mouse event listener. The function I call, "showInfowindow" looks like this: private function showInfoWindow(latlng:LatLng):void { var options:InfoWindowOptions = new InfoWindowOptions({title: appData[*I NEED A UNIQUE ID HERE!!!*].type + " Summary", contentHTML: appData[*I NEED A UNIQUE ID HERE!!!*].info}); this.map.openInfoWindow(latlng, options); } I thought I was onto something by being able to pass a variable in my event listener declaration, but it simply hates having a dynamic variable passed through, it only returns the last value use. Example: marker.addEventListener(MapMouseEvent.ROLL_OVER, function(e:MapMouseEvent):void { showInfoWindow(e.latLng, record.unit_id) }, false, 0, false); That solution is painfully close to working. I iterate through a loop to create my markers when I try the above solution and roll over a marker I get information, but every marker's information reflects whatever information the last marker created had. I apologize for the long explaination but I just wanted to make my question as clear as possible. Does anyone have any ideas about how to patch up my almost-there-solution that I posted at the bottom or any from the ground up solutions? Thanks in advance, Peter Hanneman

    Read the article

  • Acess itemRenderer in List

    - by dede
    How to access List itemRenderer and its properties (Spark - Flex 4)? I want to iterate through list and do something like (note it's pseudo code): for (var i=0;i<NUMBER_OF_ITEMS_IN_LIST; i++){ myList.getItemRenderer[i].property }

    Read the article

  • Wrong getBounds() on LineScaleMode.NONE

    - by ghalex
    I have write a simple example that adds a canvas and draw a rectangle with stroke size 20 scale mode none. The problem is that if I call getBounds() first time I will get a correct result but after I call scale(); the getBounds() function will give me a wrong result. It will take in cosideration the stroke but stroke has scalemode to none and on the screen nothing happens but in the result I will have a x value smaller. Can sombody tell me how can I fix this ? protected var display :Canvas; protected function addCanvas():void { display = new Canvas(); display.x = display.y = 50; display.width = 100; display.height = 100; display.graphics.clear(); display.graphics.lineStyle( 20, 0x000000, 0.5, true, LineScaleMode.NONE ); display.graphics.beginFill( 0xff0000, 1 ); display.graphics.drawRect(0, 0, 100, 100); display.graphics.endFill(); area.addChild( display ); traceBounce(); } protected function scale():void { var m :Matrix = display.transform.matrix; var apply :Matrix = new Matrix(); apply.scale( 2, 1 ); apply.concat( m ); display.transform.matrix = apply; traceBounce(); } protected function traceBounce():void { trace( display.getBounds( this ) ); }

    Read the article

  • how to optimize illustrator artwork in flash?

    - by sasi
    I'm working on a flash project that incorporates a lot of artwork done in Illustrator CS4. I've been copy-pasting directly from Illustrator into Flash, and I add some animations as well. Final file is going to be a one single swf file which will be a part of UI for an application and .net will be the core for this. But now flash becomes unusable slow to respond for actions. My machine is a fast i7 with 6gb of RAM, so I don't think that's the issue. We are going to use this file with dual core atom processors. Does anyone have ideas for alternative importing techniques, optimizations within illustrator, anything at all that will make this more manageable? Thanks

    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

  • Decode amf3 object using PHP

    - by Xuki
    My flash code: var request=new URLRequest('http://localhost/test.php'); request.method = URLRequestMethod.POST; var data = new URLVariables(); var bytes:ByteArray = new ByteArray(); bytes.objectEncoding = ObjectEncoding.AMF3; //write an object into the bytearray bytes.writeObject( { myString:"Hello World"} ); data.data = bytes; request.data = data; var urlLoader:URLLoader = new URLLoader(); urlLoader.dataFormat = URLLoaderDataFormat.BINARY; urlLoader.addEventListener(Event.COMPLETE, onCompleteHandler); urlLoader.load(request); function onCompleteHandler(evt:Event):void { trace(evt.target.data); } PHP code: define("AMF_AMF3",1); $data = $_POST['data']; echo amf_decode($data, AMF_AMF3); Basically I need to send an AMF3 object from Flash to PHP and unserialize it. I'm using AMFEXT extension but couldn't get it to work. Any idea?

    Read the article

  • How to make the Rounded corners of the client app in WindowedApplication?

    - by SpawnCxy
    Hi all In my application,showFlexChrome is set as true in WindowedApplication,and the *-app.xml is setted as follows <systemChrome>none</systemChrome> <transparent>true</transparent> <visible>true</visible> I know how to make the top border rounded corners with follow codes: borderStyle="solid" cornerRadius="8" But I cannot find a method to make the bottom border of my app window rounded-corner. Suggestions would be appreciated! Regards

    Read the article

  • Tree item edit event listener in flex

    - by Biroka
    I want to catch itemEditEnd in a tree control, but i'm having a little trouble. I call the item editing a bit different: <mx:Tree id="tree" width="100%" height="100%" itemDoubleClick="treeProjects_itemDoubleClickHandler(event)" doubleClickEnabled="true" editable="true" itemEditBeginning="treeProjects_itemEditBeginingHandler(event)" itemEditEnd="treeProjects_itemEditEndHandler(event)" > but: protected function treeProjects_itemEditBeginingHandler(event:ListEvent):void { event.preventDefault(); } i do this, because I want to edit the field just when clicking rename in the context menu. And when I click rename in the context menu, this is what i'm doing (contextParentItem is the event catched on itemRollOver in the tree) : Tree( contextParentItem.target ).editedItemPosition = { columnIndex: 0, rowIndex: contextParentItem.rowIndex }; Thisway I can't catch the itemEditEnd event, but I want to handle some stuff, like: if the new entered value is an empty string, then I don't want to accept the new value if I hit ESC then, the old value should remain.

    Read the article

  • How to check if a SWF is running as an AIR app?

    - by Sandro
    Hi, I'm wondering if there is a way for a SWF to check at runtime whether it is running as an online SWF or an AIR app? I need to use the same SWF to run both online and locally, however when running as an AIR app, external assets are located in a different directory. I'd like to check whether a SWF is local or online so I can change the source path for external assets accordingly. Thanks, Sandro Edit: I just realized this might be a dumb question. :) I may just use flashvars to tell the SWF that it is running within an AIR app.

    Read the article

  • Flash, parameters, security

    - by Quandary
    Hi, I have a question: In Flash, I have the ability to save certain info onto the server. Now the problem is the user needs to be authenticated as admin in order to do so. I can't use sessions, since if you work longer than 20 minutes in the Flash application, the session is gone. The way I see it, I have 2 possibilities: 1. passing a parameter (bIsAdmin) to Flash from the Website. 2. Launch a http-get request, to get this value (bIsAdmin) from an ashx handler on application startup, when the session has not yet exired. In my opinion, both possibilities are not really secure... So, Which one is safer, 1 or 2? Or does anybody have a better idea ? In my opinion, 1 is safer, because with 2, you can just switch a packet tamperer in between, and bang, you're admin, with permission to save (or overwrite, =delete) anything.

    Read the article

  • Is it possible to resize a SpriteAsset without adding it to the display list?

    - by Sophistifunk
    Hi guys, I have an embedded image asset (with a scale9 grid), and I'm trying to get the bitmapdata when it's resized, but I can't seem to do this without adding it to the display list. I try this: spriteAsset.setActualSize(w,h); spriteAsset.width = w; bmd.draw(spriteAsset); But when I then draw out the bitmapdata with graphics.beginBitmapFill(), I just get the original un-stretched image. Any pointers? Or do I need to take 9 separate BitmapData images and make 9 separate bitmap fills? Cheers, -Josh

    Read the article

  • How do I replace colours in a movieclip?

    - by Oli
    I am trying to take a movieclip of a character and change the colour of their clothes. The character is comprised of vectors. So far I have semi-sucessfully used this method: stop the movieclip take the bitmap data from the current frame use threshold to replace the colour store the resulting bitmap data in an array add an onenterframe function - clear the current frame and add the bitmap data from the processed data in the array So - this works pretty well. Each frame is only processed once at the beginning and then the write to the movieclip is very quick. However! As the replacement is being performed on a bitmap there is an amount of aliasing that takes place to remove jaggies/pixelation. This produces colours that are not matched using threshold. So the main colour is replaced correctly but it is surrounded by a halo of mixed colours :( I am sure there should be a better way to do this. Any ideas or answers would be greatly apreciated - Thanks.

    Read the article

  • Possible to manipulate UI elements via dispatchEvent()?

    - by rinogo
    Hi all! I'm trying to manually dispatch events on a textfield so I can manipulate it indirectly via code (e.g. place cursor at a given set of x/y coordinates). However, my events seem to have no effect. I've written a test to experiment with this phenomenon: package sandbox { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.utils.setTimeout; public class Test extends Sprite { private var tf:TextField; private var tf2:TextField; public function Test() { super(); tf = new TextField(); tf.text = 'Interact here'; tf.type = TextFieldType.INPUT; addChild(tf); tf2 = new TextField(); tf2.text = 'Same events replayed with five second delay here'; tf2.autoSize = TextFieldAutoSize.LEFT; tf2.type = TextFieldType.INPUT; tf2.y = 30; addChild(tf2); tf.addEventListener(MouseEvent.CLICK, mouseListener); tf.addEventListener(MouseEvent.DOUBLE_CLICK, mouseListener); tf.addEventListener(MouseEvent.MOUSE_DOWN, mouseListener); tf.addEventListener(MouseEvent.MOUSE_MOVE, mouseListener); tf.addEventListener(MouseEvent.MOUSE_OUT, mouseListener); tf.addEventListener(MouseEvent.MOUSE_OVER, mouseListener); tf.addEventListener(MouseEvent.MOUSE_UP, mouseListener); tf.addEventListener(MouseEvent.MOUSE_WHEEL, mouseListener); tf.addEventListener(MouseEvent.ROLL_OUT, mouseListener); tf.addEventListener(MouseEvent.ROLL_OVER, mouseListener); } private function mouseListener(event:MouseEvent):void { //trace(event); setTimeout(function():void {trace(event); tf2.dispatchEvent(event);}, 5000); } } } Essentially, all this test does is to use setTimeout to effectively 'record' events on TextField tf and replay them five seconds later on TextField tf2. When an event is dispatched on tf2, it is traced to the console output. The console output upon running this program and clicking on tf is: [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=0 localY=1 stageX=0 stageY=1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="rollOver" bubbles=false cancelable=false eventPhase=2 localX=0 localY=1 stageX=0 stageY=1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseOver" bubbles=true cancelable=false eventPhase=3 localX=0 localY=1 stageX=0 stageY=1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=2 localY=1 stageX=2 stageY=1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=2 localY=2 stageX=2 stageY=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=2 localY=3 stageX=2 stageY=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=3 localY=3 stageX=3 stageY=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=5 localY=3 stageX=5 stageY=3 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=6 localY=5 stageX=6 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=7 localY=5 stageX=7 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=9 localY=5 stageX=9 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=10 localY=5 stageX=10 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=11 localY=5 stageX=11 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=12 localY=5 stageX=12 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseDown" bubbles=true cancelable=false eventPhase=3 localX=12 localY=5 stageX=12 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseUp" bubbles=true cancelable=false eventPhase=3 localX=12 localY=5 stageX=12 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="click" bubbles=true cancelable=false eventPhase=3 localX=12 localY=5 stageX=12 stageY=5 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=10 localY=4 stageX=10 stageY=4 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=9 localY=2 stageX=9 stageY=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=3 localX=9 localY=1 stageX=9 stageY=1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="mouseOut" bubbles=true cancelable=false eventPhase=3 localX=-1 localY=-1 stageX=-1 stageY=-1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] [MouseEvent type="rollOut" bubbles=false cancelable=false eventPhase=2 localX=-1 localY=-1 stageX=-1 stageY=-1 relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0] As we can see, the events are being captured and replayed successfully. However, no change occurs in tf2 - the mouse cursor does not appear in tf2 as we would expect. In fact, the cursor remains in tf even after the tf2 events are dispatched. Please help! Thanks, -Rich

    Read the article

  • Center the stage in Flash CS4/AS3 on a standalone player

    - by Technoh
    I have a Flash presentation (made in Flash CS4 with AS3) I am working on and running in a standalone Flash player. When I start the presentation the stage is centered in the Flash player, even if I resize it. The presentation contains an FLVPlayback component which, at different frames, plays different content. A navigation menu (made of buttons) is used to move through the different frames. My problem is that if the player is resized so that it is bigger than the stage, sometimes after going into and exiting from fullScreen mode, the stage is moved to the left and I cannot find a way to move it back to the center. I cannot stage the scale as the content becomes distorted and I do not want to force fullScreen all the time. I would just like to center the stage in the Flash player. Is such a thing possible? Any help is greatly appreciated.

    Read the article

  • How to use AIR 2.0 NativeProcess API with Java?

    - by dede
    How do you use this great new API in connection with Java? Do you use just pure native process API like nativeProcess.standardInput.write() and nativeProcess.standardOutput.read() with which you cannot debug Java side neither invoke remote java method. Or you are using some library that leverages remote method invocation such as flerry lib but that also cannot debug Java side? Or maybe you are using Merapi with which you can debug but cannot remotely invoke Java method? I'm asking this because this is maybe the most important question regarding this API and its ease of use.

    Read the article

  • Is there a way to convert a swf to an .abc file?

    - by Jeremy Ruppel
    I'm looking for a way, preferably a command-line utility, to pump out an .abc file for a compiled swf. I've looked into asc.jar, but so far it seems like it can only accept classes, not compiled swfs. Anybody know of a good way to do this? The end-goal of this process is to use Zwetan's RedTamarin project to run describeType on some specific classes inside a loaded swf, but there are complications with SecurityDomain preventing me from using Loader.loadBytes. If there's another good way to describe classes in the loaded swf via command-line, I'd be interested in that solution as well. Cheers, J

    Read the article

  • how determine if a video is loaded in flex sdk 3.4?

    - by xaguilars
    Hello I wanted to know which event determines if a external video is loaded (using Action Script 3, Flex SDK 3.4 compiler and FlashDevelop -VideoEvent is not present here-). I'm using a flash.media.video component I've tried with NetStatusEvent.NET_STATUS and "NetStream.Buffer.Full" but it does not seem to work. Thank you.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >