Search Results

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

Page 3/37 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • as3 tracking number value of variables

    - by Wade D Ouellet
    Hi, I have a bunch an as3 game going. In my game when newCrag hits egg_mc the score gets added. // Add the score var newScore:score_mc; newScore = new score_mc(); addChild(newScore); newScore.x = 20; newScore.y = 20; newScore.score_txt.text='0/15'; var score:Number=0; function getEggs(event:Event):void { if(event.target.hitTestObject(MovieClip(root).newCrag) && event.target is egg_mc) { sndEgg.play(); if(event.target.stage) { event.target.parent.removeChild(event.target); } // Increase score score++; newScore.score_txt.text = "" + score + '/15'; } } I am trying to refer to the number value of the score using if statements. I need to change the speed variables based off the number that is inside the score box. var speed:Number if(score > 10 || score == 10) { speed=20; trace("speed3"); } else if(score > 5 || score == 5 && score < 10) { speed=18; trace("speed2"); } else { speed=14; trace("speed1"); } However, this part of the code is not working. Any help would be much appreciated. Thanks, Wade

    Read the article

  • How to protect a form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • How to protect and hidden form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • Flash AS3: (VideoEvent.COMPLETE, completePlay) - listener is triggered before video is completed

    - by Tevi
    Hello, I have a flash video using the standard FLV Playback component that comes with Flash. I'm using ActionScript 3 to modify the appearance and set up an event listener. I've set it up to go to a new URL using "externalInterface" when the video completes play. The URL is set in a variable using SWFObject. On only a few instances (3 people out of 50 - tested using Amazon Turk), people reported being taken directly to the new url, before the video even started playing. It's difficult to repeat the issue, but it did happen to me once. It doesn't have anything to do with cache, since it has been reported on people going to the url for the first time. Here's the url to the video: http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/ViewStaticPage-UnFramed?page=tourthetown Here's the code: import flash.external.*; import fl.video.*; var myVideo:FLVPlayback = new FLVPlayback(); var theUrl:String = this.loaderInfo.parameters.urlName; var theScript:String = this.loaderInfo.parameters.scriptName; myVideo.source = this.loaderInfo.parameters.videoPath;//"partstown.flv"; myVideo.skin = this.loaderInfo.parameters.skinPath;//"SkinUnderPlayStopSeekMuteVol.swf" myVideo.skinBackgroundColor = 0xAEBEFB; myVideo.skinBackgroundAlpha = 0.5; myVideo.width = 939; myVideo.height = 660; myVideo.addEventListener(VideoEvent.COMPLETE, completePlay); function completePlay(e:VideoEvent):void { myVideo.alpha=0.2; ExternalInterface.call(theScript); } addChild(myVideo); Why would the listener be triggered before the event complete? How can I fix it? Thanks!

    Read the article

  • Drag and drop in as3 on specific path (ex bezier curve)

    - by abinop
    I need to implement a drag and drop functionality, where I can define and constraint the route of the draggable object. Like in http://www.kirupa.com/forum/showthread.php?t=330302 , only that i have the paths designed and not calculated by a math function. So, in fact, as mouse moves I need to tell the object to follow the custom path/movieclip.

    Read the article

  • Drawing Shapes in Flex 4/AS3 addchild issues

    - by Parris
    Hi All, I am simply trying to draw a rectangle inside of a panel using flex4. I am using spark instead of mx. It complains about addchild being replaced by addelement; however, addelement expects type ivisualcomponent. I think sprite should be of that type; however, it reports an error when trying to use the below code... I have tried a few different ways. I think I am missing something very basic about flex 4. Any enlightenment would be much appreciated! :-D private function drawRectangle(e:MouseEvent):void{ var s:Sprite = new Sprite(); s.graphics.beginFill(0x00ff00, 0.5); s.graphics.drawRect(e.localX,e.localY,50,50); s.graphics.endFill(); canvas.addChild(s); }

    Read the article

  • Making a mini paint area in AS3/Flex4

    - by Parris
    So below is the code I have so far. For now I simply want to make it draw a square and have it show up. Right now when I click the area defined in MXML as <components:PaintArea width="100%" height="100%" id="paint-a"></PaintArea> it shows nothing; however, the actionlistener is getting triggered and an element is being added to the group. Not sure exactly what is going on... perhaps for some reason it doesn't think the element is drawable? Anyways thanks for the help! public class PaintArea extends SkinnableContainer { private var canvas:Group; public function PaintArea() { super(); canvas = new Group(); canvas.clipAndEnableScrolling = true; canvas.percentHeight = 100; canvas.percentWidth = 100; canvas.addEventListener(MouseEvent.MOUSE_UP,drawRectangle); this.addElement(canvas); } private function drawRectangle(e:MouseEvent):void{ var r:Rect = new Rect(); r.fill = new SolidColor(0x00ff00,.5); canvas.addElement(r); } }

    Read the article

  • Trying to draw a Rectangle to a Custom Container in Flex4/AS3

    - by Parris
    So below is the code I have so far. For now I simply want to make it draw a square and have it show up. Right now when I click the area defined in MXML as <components:PaintArea width="100%" height="100%" id="paint-a"></PaintArea> it shows nothing; however, the actionlistener is getting triggered and an element is being added to the group. Not sure exactly what is going on... perhaps for some reason it doesn't think the element is drawable? Anyways thanks for the help! public class PaintArea extends SkinnableContainer { private var canvas:Group; public function PaintArea() { super(); canvas = new Group(); canvas.clipAndEnableScrolling = true; canvas.percentHeight = 100; canvas.percentWidth = 100; canvas.addEventListener(MouseEvent.MOUSE_UP,drawRectangle); this.addElement(canvas); } private function drawRectangle(e:MouseEvent):void{ var r:Rect = new Rect(); r.fill = new SolidColor(0x00ff00,.5); canvas.addElement(r); } }

    Read the article

  • Face Recognition in AS3

    - by dontPanic
    Hey all, I have been working on a project which involves Marilena(project that ports Face Detection part of OPENCV to ActionScript3). Right now I can take the faces and keep them as byteArrays. I am working on Flash Builder 4. I want to add Face Recognition part either. I will identify the faces by connecting to a database but I couldnt figure out how to do it without OpenCV on flash.You guys have any idea???

    Read the article

  • AS3 change lineStyle of existing line

    - by Ozzy
    Hi all im drawing a line from 0,0 to 100,100 im using this to modify the linestyle: draw_line.graphics.lineStyle(1, 0xFF0000); That line is now of 1 thickness. Is there anyway i can change the thickness of the line to say 10, but without redrawing the line?

    Read the article

  • Flash CS3/AS3 - How to Mask Nested MovieClips in External Classes

    - by Max Jackson
    I have a number of external class files that make up (or are trying to build) a portfolio. One of the class files for this project is a Menu.as class I tried extends, but I'm yet to use extends to where it doesn't become a ball of tangled holiday cheer. So my main portfolio class (the one where I'm assembling everything) calls an instance of the Menu class. From the Preloader through the Portfolio class into the Menu class is where I'm passing the content because I want to package things properly. This is Menu content, so naturally I want to position it in a properly names spot. I'm trying to reveal this Menu in a mask and I'm getting the old #1009 error. In a trace, this will work: trace(site_mc.menu_mc.mainMask_mc); // returns [object mainMask_mc_4] However, when I try to truncate the string into a single compact_mc... compactMenu_mc = site_mc.menu_mc.mainMask_mc; trace(compact_mc); // it won't trace (#1009). I said to hell with it, but now I need to have one MovieClip mask another. So I figure I can't go all... parent.parent.parent.clip_mc.mask = parent.parent.parent.masked_mc Probably because of datatyping and whatever else. I hate to be vague, but I'm new and have been working like gangbusters for days to get this portfolio up. Any suggestions or pointers on things my noob brain might've missed are given much thanks. :)

    Read the article

  • AS3 serialization of Vector of custom objects

    - by aaaidan
    What is serialization support like for the new Vector class. I have a Vector.<GameMove> which I'd like to serialize into a ByteArray. GameMove is a custom class. I presume it's necesssary to call registerClassAlias() on GameMove, but do I also have to register Vector.<GameMove>? It's it it's own distinctive type, or is it kinda composed of those two types?

    Read the article

  • Facebook Graph API - Image Uploading (as3/flash)

    - by lollertits
    I have been trying to get a bit more familiar with the Graph API for facebook. Its very convenient although the documentation is poor at some places. Im having trouble uploading an image to an album. Anyone know how to do it ? This is the code im currently working on :) private function uploadNewPic(albumId:String):void { var bmd1:BitmapData = new BitmapData(200, 200, false, 0x666666); var bm1:Bitmap = new Bitmap(bmd1); var jpgEncoder:JPGEncoder = new JPGEncoder(); var ba:ByteArray = jpgEncoder.encode(bmd1); var data:URLVariables = new URLVariables(); data.message = "Message"; data.image = ba; data.photos = ba; data.url = ba; var method:String = URLRequestMethod.POST; var loader:URLLoader = facebook.call(albumId + "/photos", data, method); loader.addEventListener(FacebookOAuthGraphEvent.ERROR, onPicError); loader.addEventListener(FacebookOAuthGraphEvent.DATA, onPicUploaded); } Im pretty much down to trial and error :) Any ideas ?

    Read the article

  • AS3: How to get fullscreen and keyboard input?

    - by Tinelise
    Since flash doesn't allow keyboard input while in fullscreen mode I'm wondering if there is a workaround to that? I have a flash that is going to run fullscreen in a browser and needs different kinds of keyboard input. I have read something about AIR, but I don't fully understand it and would like another way if thats even possible. Anybody knows?

    Read the article

  • as3 loops and event listeners

    - by Ross
    I have an array that returns multidimensional data from an mysql database, when this is collected the createNews function creates the user interface. The problem I am having is the loop is iterating quicker than the ui is being created, is there a way to use event listeners with loops so it only continues after my function has completed its work. Any solutions or ideas are much appreciated; Thanks, R. var t:Array = responds.serverInfo.initialData; for (var i:uint = 0; i < t.length; i++) { var date = t[i][1]; var newstitle = t[i][2]; var story= t[i][3]; var image = t[i][4]; createNews(date, newstitle, story, image); }

    Read the article

  • Combine Text with a Draggable Mask AS3.0

    - by RC
    So I have an image that is the size of the stage: img_mc. Then I drew a small rectangle: mask_mc. The idea is to make a "window" of the small rectangle, view img_mc through the window, and be able to drag the window around. The following code works fine but I want to add text to the mask - "Drag Me!" or whatever. But if I group text with the mask it breaks down. If I make a separate text_mc I can drag it around but it's not part of the mask. How can I combine text with a mask? (sorry if this question is pathetically easy!) Thanks for any thoughts you can share! img_mc.mask = mask_mc; mask_mc.buttonMode = true; img_mc.cacheAsBitmap = true; //because I blurred the mask text_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragF); mask_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragF); stage.addEventListener(MouseEvent.MOUSE_UP, dropF); function dragF(event:MouseEvent):void{ mask_mc.startDrag(); } function dropF(event:MouseEvent):void{ mask_mc.stopDrag(); }

    Read the article

  • Flash (AS3) can't read response ...

    - by Quandary
    Question: I call an asp.net handler (ashx) like this from Flash, and onLoadSuccessful, I get the ashx response back. The problem now is whatever I do in onLoadSuccessful to get the responseStatus variable never gets me the variable (just an error message: property responseStatus for string not found), but the output of: trace("Response: " + evt.target.data); is Response: &responseStatus=ASP.NET+Fehler%3a+Die+Datei+%22C%3a%5cinetpub%5cwwwroot%5cRaumplaner_New%5cRaumplaner_New%5cabcdef.xml%22+konnte+nicht+gefunden+werden.& It used to work in ActionScript2... Any hints as to what I do wrong ? I mean the request gets sent, and the reponse received, but no matter how I try to do it, I can't access the responseStatus variable... var scriptRequest:URLRequest = new URLRequest(strURL); var scriptLoader:URLLoader = new URLLoader(); var scriptVars:URLVariables = new URLVariables(); scriptLoader.addEventListener(Event.COMPLETE, onLoadSuccessful); scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); scriptLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError); scriptVars.ScaleString = nScale; scriptVars.ModifyFile = "abcdef.xml"; scriptRequest.method = URLRequestMethod.POST; scriptRequest.data = scriptVars; scriptLoader.load(scriptRequest); function onLoadSuccessful(evt:Event):void { trace("Success."); //ExternalInterface.call("alert", "Die neue Skalierung wurde erfolgreich gespeichert."); //getURL("javascript:alert(\""+"Die neue Skalierung wurde erfolgreich gespeichert.\\nALLE Instanzen des Browsers schliessen und neu starten, damit die Änderung in Kraft tritt."+"\");"); trace("Response: " + evt.target.data); trace("ResponseStatus: " + evt.target.data.responseStatus); var loader:URLLoader = URLLoader(evt.target); trace("responseStatus: " + loader.data.responseStatus); }

    Read the article

  • how can I unload a swf with AS3?

    - by Ole Media
    Any body can help on how I can do to unload a swf before I load the next one? var mLoader:Loader = new Loader(); function loadSWF(e:Event):void { var imageId:Array = e.target.name.split("_"); var targetId:int = imageId[0]; var caption:int = imageId[1]; txt = arrayText[caption]; dynText1.text = ""; dynText1.text = arrayText[caption]; dynText1.setTextFormat(textFormatMain); var swf:String = "swf/" + xmlList[targetId].image[caption].@swf; if (mLoader.content != null) { swfLoad.swfArea.mLoader.unload(); swfLoad.swfArea.mLoader.load(null); } mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); mLoader.load(new URLRequest(swf)); } //-------------------------------------------------------------------------// function onCompleteHandler(loadEvent:Event):void { swfLoad.swfArea.addChild(loadEvent.currentTarget.content); TweenLite.to(swfLoad, 0.5, {alpha:1}); } function onProgressHandler(mProgress:ProgressEvent):void { //var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal; //trace(percent); }

    Read the article

  • AS3 - Event listener that only fires once

    - by Zed-K
    I'm looking for a way to add an EventListener which will automatically removes itself after the first time it fires, but I can't figure a way of doing this the way I want to. I found this function (here) : public class EventUtil { public static function addOnceEventListener(dispatcher:IEventDispatcher,eventType:String,listener:Function):void { var f:Function = function(e:Event):void { dispatcher.removeEventListener(eventType,f); listener(e); } dispatcher.addEventListener(eventType,f); } } But instead of having to write : EventUtil.addOnceEventListener( dispatcher, eventType, listener ); I would like to use it the usual way : dispatcher.addOnceEventListener( eventType, listener ); Has anybody got an idea of how this could be done? Any help would be greatly apprecitated. (I know that Robert Penner's Signals can do this, but I can't use them since it would mean a lot of code rewriting that I can't afford for my current project)

    Read the article

  • using nested arrays by php http_build_query() and recieve them in flash AS3

    - by Mahmoud
    hi, i am having this hard time figuring what is needed to do, i am using URLVariables to send/recieve values between flash and PHP the problem is, i am unable to access nested arrays ( array inside an array ) with flash heres an example: $dgresult = array("total" = $results); echo http_build_query($dgresult,"flf_"); in flash, all i need to do is to use: var variables:URLVariables = new URLVariables(e.target.data); then i can access it with : variables.total the problem now is when i have nested arrays: $dgresult = array("total" = $results); array_push($dgresult,$another_array); http_build_query($dgresult,"flf_"); i can still access variables.total but what about anything that has flf_ ? how is that possible?

    Read the article

  • as3 - controlling flicker when scaling up a button or movieclip

    - by sol
    This is a situation I run into a lot but never seem to find a good solution. I have movieclips that I scale up slightly on rollover, but if you hover over the edge of the movieclip it just sits there and flickers, continuously receiving mouseOver and mouseOut events. How do you deal with this? Again, it's usually a problem when tweening the scale of a movieclip or button. my_mc.addEventListener(MouseEvent.MOUSE_OVER, mOver); my_mc.addEventListener(MouseEvent.MOUSE_OUT, mOut); private function mOver(m:MouseEvent) { TweenLite.to(m.target, .2, { scaleX:1.1, scaleY:1.1} ); } private function mOut(m:MouseEvent) { TweenLite.to(m.target, .2, { scaleX:1, scaleY:1} ); }

    Read the article

  • Flash/AIR AS3: comparing contents of Screen.screens

    - by matt lohkamp
    In a sane world, this works as expected: var array:Array = ['a','b','c]; trace(array.indexOf(array[0])); // returns 0 In an insane world, this happens: trace(Screen.screens.indexOf(Screen.screens[0])); // returns -1 ... if Screen.screens is an Array of the available instances of Screen, why can't that array give an accurate indexOf one of its own children? edit - apparently to get back to the world of the sane, all you have to do is this: var array:Array = Screen.screens; trace(array.indexOf(array[0])); // returns 0 Anyone know why?

    Read the article

  • How Can I Detect A Data Type in AS3

    - by Jascha
    I'd like to make a call to a function and send either a string or an integer... function getImage(val:*):void{ if(val == String){ switch(val){ case'next': loadNext(); break; case'prev': loadPrev(); break } } }else{ loadImg(val); } } and vary my function accordingly... anyone know how to detect the parameter type? Thanks -J

    Read the article

  • Flash CS4/AS3 Dynamic Text Box

    - by Jono
    Hi, I have created a XML image gallery, which displays text in between each slide. Now I have created a movie clip with a dynamic text field (with Render HTML selected) to display the text from the XML which is pushed into an array. Now, this all works great BUT... /n or /r is not creating a new line break (as they need to be custom). Yet if I create an Array and manually push strings "Bla bla bla /n bla bla bla" I get a line break. I have tried converting the Array item to string (even though it already is), I would also avoid creating textField = new textField() any Ideas would be welcomed. Cheers

    Read the article

  • External XML and AS3

    - by VideoDnd
    I want to pass external XML a variable. How do I do this? WHAT I'M AFTER - update my variable with COUNT XML WHAT I'M NOT GETTING - The integer to String values - How to pass XML to a variable link http://videodnd.weebly.com/ time.xml <?xml version="1.0" encoding="utf-8"?> <SESSION> <COUNT TITLE="starting position">-77777</COUNT> </SESSION> xml.fla //VARIABLES /*CHANGE TO COUNT MyString or count, I don't know if it was necessary to go from int to String */ var myString:String = ""; var count:int = int(myString); trace(count); //LOAD XML var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("time.xml")); myLoader.addEventListener(Event.COMPLETE, processXML); //PARSE XML function processXML(e:Event):void { myXML = new XML(e.target.data); trace(myXML.COUNT.*); trace(myXML); //TEXT var text:TextField = new TextField(); text.text = myXML.COUNT.*; addChild(text); } output window 'traces to the output window correctly' //zero should read -77777 if tracing correctly 0 -77777 <SESSION> <COUNT TITLE="starting position">-77777</COUNT> </SESSION> errors coercion errors and null references with anything I attempt.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >