Search Results

Search found 6496 results on 260 pages for 'neon flash'.

Page 122/260 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • How do I know which Object I clicked?

    - by Nick
    Here's the deal: I'm working on a personal portfolio in AS3 and I've run into a problem which I can't seem to find a logical answer to. I want everything (well, most of it) to be editable with an XML file, including my menu. My menu is just a Sprite with some text on it and a Tweener-tween, no big deal. But, I forgot to think of a way how I can determine which menu-item I have clicked. This is in my Main.as private function xmlLoaded(e:Event):void { xml = e.target.xml; menu = new Menu(xml); menu.x = 0; menu.y = stage.stageHeight / 2 - menu.height / 2; addChild(menu); } In Menu.as public function Menu(xml:XML) { for each (var eachMenuItem:XML in xml.menu.item) { menuItem = new MenuItem(eachMenuItem); menuItem.y += yPos; addChild(menuItem); yPos += menuItem.height + 3; } } and in my MenuItem.as, everything works - I have a fancy tween when I hover over it, but when I click a menu-item, I want something to appear ofcourse. How do I know which one I clicked? I've tried with pushing everything in an array, but that didn't work out well (or maybe I'm doing it wrong). Also tried a global counter, but that's not working either because the value will always be amount of items in my XML file. Also tried e.currentTarget in my click-function, but when I trace that, all of them are "Object Sprite".. I need something so I can give each a unique "name"? Thanks in advance!

    Read the article

  • Using Sandy 3D AS3, fill the viewport (exact fit) with multiple 3D objects.

    - by Andrew Mullins
    I'm stitching together an image using multiple instances of the sandy.primitive.Box. Each box is 96x91 while the viewport is 960x273 which should make for an exact fit if I layout the boxes in a perfect grid of 10x3. However, I can't seem to get the exact camera fieldOfView. I've tried a couple formulas (one for adjusting the "focal length" and one for adjusting the fov, directly). Both of these formulas produce a fov angle that is too narrow. // focal length (stage.stageHeight/2) / Math.tan(cam.fov / 2 * Math.PI / 180) // field of view 2 * Math.atan2( (stage.stageHeight/2), -cam.z ) * (180 / Math.PI) Another question about the same project: I need to adjust the perspective of each cube so that the image appears to be in 2D space (flat)... Any ideas on the best method for calculating such a "correction"?

    Read the article

  • Generating Source Info For Flex BitmapData.

    - by Joshua
    Instead of populating the BitmapData class from an IMAGE. I would like to (within Actionscript) GENERATE some new BitmapData by capturing the Bitmap representing say, a TextArea component on the stage. In other words, sort of take a "screen capture" or "screenshot" of one of the components, and convert that into an image. Am I silly to even wonder if such a thing is feasible? Can an Air/Flex app "look at itself" in this way? Can it turn a datagrid or a canvas or a textinput into the corresponding image AS IF via screen capture? Even a hint in the right direction would be appreciated, Thanks In Advance.

    Read the article

  • How to add a new Stage to my default stage?

    - by Raigomaru
    I want to add a new Stage called field to the default stage (i need to place different elements on it later). And then i want to add a bitmap called myBitmap to the field. But nothing happens. I don't understand what should i do... var field:Stage = new Stage(); field.x = 200; field.y = 200; field.width = 300; field.height = 300; stage.addChild(field); var bdWidth:Number = 100; var bdHeight:Number = 100; var bdTransparent:Boolean = true; var bdFillColorARGB:uint = 0xFF007090; var myBitmapData:BitmapData = new BitmapData(bdWidth, bdHeight, bdTransparent, bdFillColorARGB); var myBitmap:Bitmap = new Bitmap(myBitmapData); myBitmap.x = 10; myBitmap.y = 10; field.addChild(myBitmap);

    Read the article

  • How to create an object from 2 arrays?

    - by Ole Jak
    So I hava array Links and array Params with same langth N So what I need is to create an object where for each link from Links I will be able to see param from Params And than for example to be abble to call something like for each( item in object) if (item.param == "some value") { // some code } else... How to do such thing (Code exaMple, please)

    Read the article

  • Running The JVM From Within An MXML Component

    - by Joshua
    Thinking outside of the box here... What possible basic approaches could be taken in an effort to create a Flex component that could run Java? I know I can easily use flex to browse to or launch a Java app, but there are things I can only do if I can run the Java from WITHIN an MXML Component. I the strictest sense, I know it's not impossible (ie: if you had all the source code for flex and for the jvm), but what's the least impractical means to this end? Showcase your creativity.

    Read the article

  • As3 printing problem, blanks swf after print or cancel

    - by Carlos Barbosa
    Hey all! ok back at another issues in as3 printing Code: //Function to print entire screen function printFunction(event:MouseEvent):void { var myPrintJob:PrintJob = new PrintJob(); var oldScaleX:Number = root.scaleX; var oldScaleY:Number = root.scaleY; //Start the print job myPrintJob.start(); //Figure out the new scale var newScaleX:Number = myPrintJob.paperWidth/root.width; var newScaleY:Number = myPrintJob.paperHeight/root.height; //Shrink in both the X and Y directions by the same amount (keep the same ratio) if(newScaleX < newScaleY) newScaleY = newScaleX; else newScaleX = newScaleY; root.scaleX = newScaleX; root.scaleY = newScaleY; //Print the page myPrintJob.addPage(Sprite(root)); myPrintJob.send(); //Reset the scale to the old values root.scaleX = oldScaleX; root.scaleY = oldScaleY; } I cant seem to find anything thats really helpful with this. When i click cancel on the print dialog box, i get error below and it blanks out my swf.

    Read the article

  • receive and pass values with XML, AS3

    - by VideoDnd
    My example imports XML and has an object rotating on stage. The rotating object is called enemy corresponds to ENEMY in the XML. How do I set the rotation variable to receive values from XML? REASON It seems more difficult to set up variables using external data. I want to understand it better. here's a link http://videodnd.weebly.com/ rotation.fla //LOAD XML var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("enemy.xml")); myLoader.addEventListener(Event.COMPLETE, processXML); //PARSE XML function processXML(e:Event):void { myXML = new XML(e.target.data); trace(myXML.ROGUE.*); trace(myXML); //TEXT var text:TextField = new TextField(); text.text = myXML.ENEMY.*; addChild(text); } //ROTATION function enterFrameHandler(event:Event):void { //==>CODE I WANT TO CHANGE<== enemy.rotationY += 10; //enemy.rotationY = myXML.ENEMY.*; } addEventListener(Event.ENTER_FRAME, enterFrameHandler); enemy.xml ENEMY is set to -100, use what you like <?xml version="1.0" encoding="utf-8"?> <BADGUYS> <ENEMY TITLE="sticky">-100</ENEMY> <ROGUE TITLE="slimy">-1000</ROGUE> </BADGUYS>

    Read the article

  • Filtering data in an array.

    - by user276424
    Hi all, I have an array that has 30 date objects. The date objects are indexed in the array from the minimum date value to the maximum date value. What I would like to do is retrieve only 7 dates from the array. Out of the 7, the first one should be the minDate and the last should be the maxDate, with 5 dates in the middle. The 7 numbers should increment evenly from the minDate to the maxDate. How would I accomplish this? Hope I was clear. Thanks, Tonih

    Read the article

  • Programmatically Detecting Valid Style Properties In Flex

    - by Joshua
    If I want to know if an object has a particular property I can code this: if (SomeObject.hasOwnProperty('xyz')) { // some code } But some styles masquerade as properties at design time such as Button.color... How can I know what style properties are valid at runtime? ie: What is the equivalent of hasOwnProperty for getStyle/setStyle? In other words how can I know if an object HAS A particular style variable... When I write: MyButton.setStyle('qsfgaeWT','-33'); It won't accomplish anything, but it also doesn't error. How can I know programmatically that 'qsfgaeWT' is NOT a valid style of 'Button'??

    Read the article

  • Is it possible to add a attachment to a mail with the mailto function in actionscript 3?

    - by SinneR
    Is it possible to add a attachment to a mail with the mailto function in actionscript 3? Thats the thing, i want to open the default mail program compose window with some data but i also need to add a file as attachment, and that file must be a screen capture of the app. Im doing some research and cant find nothing even close to this, someone have any ideas? All help will be appreciated because im really lost here. Thanks in advance ;)

    Read the article

  • OSMF seek with Amazon Cloudfront

    - by giorrrgio
    I've written a little OSMF player that streams via RTMP from Amazon Cloudfront. There's a known issue, the mp3 duration is not correctly readed from metadata and thus the seek function is not working. I know there's a workaround implying the use of getStreamLength function of NetConnection, which I successfully implemented in a previous non-OSMF player, but now I don't know how and when to call it, in terms of OSMF Events and Traits. This code is not working: protected function initApp():void { //the pointer to the media var resource:URLResource = new URLResource( STREAMING_PATH ); // Create a mediafactory instance mediaFactory = new DefaultMediaFactory(); //creates and sets the MediaElement (generic) with a resource and path element = mediaFactory.createMediaElement( resource ); var loadTrait:NetStreamLoadTrait = element.getTrait(MediaTraitType.LOAD) as NetStreamLoadTrait; loadTrait.addEventListener(LoaderEvent.LOAD_STATE_CHANGE, _onLoaded); player = new MediaPlayer( element ); //Marker 5: Add MediaPlayer listeners for media size and current time change player.addEventListener( DisplayObjectEvent.MEDIA_SIZE_CHANGE, _onSizeChange ); player.addEventListener( TimeEvent.CURRENT_TIME_CHANGE, _onProgress ); initControlBar(); } private function onGetStreamLength(result:Object):void { Alert.show("The stream length is " + result + " seconds"); duration = Number(result); } private function _onLoaded(e:LoaderEvent):void { if (e.newState == LoadState.READY) { var loadTrait:NetStreamLoadTrait = player.media.getTrait(MediaTraitType.LOAD) as NetStreamLoadTrait; if (loadTrait && loadTrait.netStream) { var responder:Responder = new Responder(onGetStreamLength); loadTrait.connection.call("getStreamLength", responder, STREAMING_PATH); } } }

    Read the article

  • Best tutorials or sites for Actionscript 3.

    - by befall
    This is semi-redudant, but the other entries on here didn't yield anything. I know a bit of AS3, but only from copying segments and attempting to figure it out. Is there any online resources for going through from the beginning and UNDERSTANDING everything, allowing me to more creatively interpret and learn it? Anything is appreciated, thanks.

    Read the article

  • Sorted array: how to get position before and after using name? as3

    - by user1560239
    I have been working on a project and Stack Overflow has helped me with a few problems so far, so I am very thankful! My question is this: I have an array like this: var records:Object = {}; var arr:Array = [ records["nh"] = { medinc:66303, statename:"New Hampshire"}, records["ct"] = { medinc:65958, statename:"Connecticut"}, records["nj"] = { medinc:65173, statename:"New Jersey"}, records["md"] = { medinc:64596, statename:"Maryland"}, etc... for all 50 states. And then I have the array sorted reverse numerically (descending) like this: arr.sortOn("medinc", Array.NUMERIC); arr.reverse(); Can I call the name of the record (i.e. "nj" for new jersey) and then get the value from the numeric position above and below the record in the array? Basically, medinc is medium income of US states, and I am trying to show a ranking system... a user would click Texas for example, and it would show the medinc value for Texas, along with the state the ranks one position below and the state that ranks one position above in the array. Thanks for your help!

    Read the article

  • Connection Limit in Adobe AIR?

    - by Brinias
    I have an Adobe AIR application that makes multiple connections to a server. When I open more than two connections I get an error: 2032: Stream Error. Is there a configuration option or a property somewhere to raise the limit?

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >