Search Results

Search found 2242 results on 90 pages for 'actionscript 3'.

Page 8/90 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Actionscript 2.0 Functions problem and somewhat "global" variable

    - by Joshua
    I have two problems. The first problem is with the following functions; when I call the function in (enterFrame), it doesn't work: onClipEvent (load) { function failwhale(levelNum) { _root.gotoAndStop("fail"); failFrom = levelNum; } function guardSightCollision(guardName, guardSightName) { if (_root.guardName.guardSightName.hitTest(_x, _y+radius, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x, _y-radius, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x-radius, _y, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x+radius, _y, true)) { failwhale(1); } } } onClipEvent (enterFrame) { guardSightCollision(guard1, guard1Sight); } Why doesn't it work?... The second problem lies in the failFrom variable: function failwhale(levelNum) { _root.gotoAndStop("fail"); failFrom = levelNum; } How do I make failFrom a "global" variable in that it can be accessed anywhere (from actionscript in frames and even movieclips)...Right now, when I try to trace failFrom in a different frame, it is "undefined".

    Read the article

  • Actionscript 2.0 Functions problem

    - by Joshua
    I have two problems. The first problem is with the following functions; when I call the function in (enterFrame), it doesn't work: onClipEvent (load) { function failwhale(levelNum) { _root.gotoAndStop("fail"); failFrom = levelNum; } function guardSightCollision(guardName, guardSightName) { if (_root.guardName.guardSightName.hitTest(_x, _y+radius, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x, _y-radius, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x-radius, _y, true)) { failwhale(1); } if (_root.guardName.guardSightName.hitTest(_x+radius, _y, true)) { failwhale(1); } } } onClipEvent (enterFrame) { guardSightCollision(guard1, guard1Sight); } Why doesn't it work?... The second problem lies in the failFrom variable: function failwhale(levelNum) { _root.gotoAndStop("fail"); failFrom = levelNum; } How do I make failFrom a "global" variable in that it can be accessed anywhere (from actionscript in frames and even movieclips)...Right now, when I try to trace failFrom in a different frame, it is "undefined".

    Read the article

  • Service for converting SWFs with ActionScript to Video (MPEG, AVI, or MOV)

    - by pcooley
    The SWF files generated by our application are a basic template that reference external resources (images, and textual data) that actionscript uses to fuel the display. Thus the SWF is responsible for the creative layout of the screen the flash player. It is the results of this actions script, images, and textual data that need to be converted to a video format. Is anyone familiar with an online service that would be able to convert such .swf files that our site generates to a video format (say .avi, .mpeg, .mov). Or an application? Note: A more common case might be the conversion of an embedded FLV to a video, but this is not our need

    Read the article

  • Applying styles for custom TextArea in ActionScript 3

    - by Vijay Dev
    I have the following code to create and apply a few styles for a custom TextArea in ActionScript 3. public class MyCustomTextArea extends TextArea { override protected function createChildren():void { super.createChildren(); this.styleSheet.setStyle("sup", { display: "inline", fontFamily: "ArialSup", fontSize:"12"}); this.styleSheet.setStyle("sub", { display: "inline", fontFamily: "ArialSub", fontSize:"12"}); this.setStyle("fontFamily", "Arial"); } } I have two problems with this code. this.styleSheet is always null when I create an instance of the class. If this.styleSheet is initialized to new StyleSheet() to avoid this issue, then the TextArea instance does not seem to recognize any of the HTML tags that can be used with the htmlText property. Can anyone help in fixing these two issues? Thanks.

    Read the article

  • How to generate graphics into photoshop using actionscript?

    - by understack
    I've a text file with content like this: id, pixelsize, color, text block1, 200x60, black, Header block2, 200x180, white, Body block2, 200x60, black, Footer Now using actionscript, I want to generate a psd file which would generate a 3 vertical block graphics (like this) after parsing the given file. All the blocks are placed vertically on top of each other. Convert this psd file into PDF automatically using the script. Automate this whole process without opening photoshop. Is it possible? Please help. Thanks.

    Read the article

  • ActionScript Aligning Graphics Line Style Stroke?

    - by TheDarkIn1978
    is it possible to align the stroke of a graphic with actionscript? for example, the following code creates a black rounded rect with a grey stroke that is automatically centre aligned. var t:Sprite = new Sprite(); t.graphics.lineStyle(5, 0x555555); t.graphics.beginFill(0, 1); t.graphics.drawRoundRect(25, 25, 200, 75, 25, 25); t.graphics.endFill(); the lineStyle function doesn't seem to offer any built-in functionality for aligning the stroke. in Adobe Illustrator, you can align a stroke to be either centre (default), inside or outside.

    Read the article

  • Actionscript NetStream.play drops port in relative URLs

    - by Steve Middleton
    Hi, the current page my flash application is running from is http://localhost:3000/. I'm trying to play a video using NetStream.play(relativeURL) by using a relative URL (e.g. "myVideo.flv"), but when I look at the actual request made by actionscript, it's dropping the port number. (e.g. http://localhost/myVideo.flv). Is there something I can do on the flash side to make this work? Is anyone else having this problem?

    Read the article

  • How to optimize frame rate in Flash/Actionscript?

    - by LillyWolf
    I'm building an application in Actionscript using Flash assets, and my frame rate becomes very low (~7 fps) when I attempt to render 20+ assets on the screen, even though most of those assets are stopped movie clips. I've tried setting .cacheAsBitmap to true, which helps a bit, but not enough. What else can I do to get the frame rate up? I've noticed that some movie clips seem to impact it more than others, but I'm not sure how to alter them to make them easier to render. Thanks!

    Read the article

  • Threading Problems in ActionScript 2.0?

    - by yar
    Is it possible to have concurrency problems (thread competition) in an onEnterFrame method in ActionScript 2.0? I have written this cheesy code as a guard: if (!busy) { // I suspect some threading problems: is that even possible in flash busy = true; movePanels(); busy = false; } but this is no assurance against thread competition. If so, how can I do a basic semaphore/lock? Note: I suspect threading problems in my app, but if they're impossible, I'll check my code differently.

    Read the article

  • How to insert complex strings into Actionscript?

    - by Ole Jak
    How to insert complex strings into Actionscript? So I have a string -vvv -I rc w:// v dv s="60x40" --ut="#scode{vcode=FV1,acode=p3,ab=128,ch=2,rate=4400}:dup{dt=st{ac=http{mime=v/x-flv},mux=mpeg{v},dt=:80/sm.fv}}" How to insert it into code like public var SuperPuperComplexString:String = new String(); SuperPuperComplexString = TO_THAT_COMPLEX_STRING; That string has so many problems like some cart of it can happen to be like regexp BUTI DO NOT want it to be parsed as any kind of reg exp - I need It AS IT IS!) How to put that strange string into variable (put it not inputing it thru UI - hardcode it into AS code)?

    Read the article

  • "Make" system for Actionscript?

    - by Ender
    In working on larger Actionscript/Flash projects, I've started to really feel the need for some kind of "make" system, but I haven't found it yet. Does anyone know if it exists? Required features: Ability to associate SWCs with their source code and/or FLAs i.e. "this swc is compiled from this source" Ability to mark my current project as depending on these SWCs (either as compile-time or runtime libraries) A single, big shiny button, that when pressed does the following: Checks to see if any of the source files have changed, and if so, recompiles their associated SWCs Recompiles and relinks the main .swf, if necessary Runs the main .swf Have yet to find a way to get something like FlashDevelop to do this (but I don't know it well enough to be sure). Support for both code and FLA sources is preferred.

    Read the article

  • Actionscript 2.0 element.text always outputs "00"

    - by Mbarry
    Hi everybody, I'm fighting against a strange behaviour with my actionscript! After setting the four integer variables from the MovieTimer sprite (hour, minute, second, mili-sec) and concate them i got always double zero: 00 stop (); delete this.onEnterFrame; var str1; var str2; var mili; var second; var minute; var hour; var timer; mili = _root.MovieTimer.txt_mili.text; second = _root.MovieTimer.txt_sec.text; minute = _root.MovieTimer.txt_min.text; hour = _root.MovieTimer.txt_heures.text; timer = hour+' : '+minute+' : '+second+' : '+mili; _root.MovieSpellFinish.TextTime.text = timer; _root.MovieSpellFinish.TextTime.text outputs: 00 is there any solutions for this??

    Read the article

  • Delays in ActionScript (Flash)? Alternatives to setInterval

    - by yar
    While setInterval is handy, it's kind of limiting. Every time I want to add a Tween I have to add a new method. I do not want to alter the structure of my code just to add in some delays. Isn't there any way to say this without making methods for A and B? // do A // wait N seconds // do B I don't want to use a while loop with Dates because I think it will be blocking. Isn't there anything like Thread.sleep in ActionScript?

    Read the article

  • trouble adding a rectange in actionscript

    - by touB
    I have a rectange that I've created and set its individual properties like so var aRect:Rect = new Rect(); aRect.x = 10; aRect.y = 10; aRect.width = "15%"; aRect.height = "15%"; addChild(aRect); I have 2 problems that the compiler seems to be choking on. The first is that the compiler chokes on 15% and "15%", with or without the quotes, neither works. The second is that adding the rectangle doesn't work. I tried all the following, but nothing works. addChild(aRect); Application.addChild(aRect); Application.application.addChild(aRect); stage.addChild(aRect); What's the deal, I thought actionscript would be nicer than mxml.

    Read the article

  • Custom broadcast events in AS3?

    - by Ender
    In Actionscript 3, most events use the capture/target/bubble model, which is pretty popular nowadays: When an event occurs, it moves through the three phases of the event flow: the capture phase, which flows from the top of the display list hierarchy to the node just before the target node; the target phase, which comprises the target node; and the bubbling phase, which flows from the node subsequent to the target node back up the display list hierarchy. However, some events, such as the Sprite class's enterFrame event, do not capture OR bubble - you must subscribe directly to the target to detect the event. The documentation refers to these as "broadcast events." I assume this is for performance reasons, since these events will be triggered constantly for each sprite on stage and you don't want to have to deal with all that superfluous event propagation. I want to dispatch my own broadcast events. I know you can prevent an event from bubbling (Event.bubbles = false), but can you get rid of capture as well?

    Read the article

  • does actionscript addChild require a display object first

    - by touB
    I'm trying to move away from mxml to actionsctipt. I have a <s:Rect> that I've created and set its properties, but having trouble adding it. var aRect:Rect = new Rect(); //set properties like aRect.x, aRect.y, aRect.width, aRect.height //tried adding it various ways addChild(aRect); Application.addChild(aRect); Application.application.addChild(aRect); stage.addChild(aRect); But I keep getting the error 1067: Implicit coercion of a value of type spark.primitives:Rect to an unrelated type flash.display:DisplayObject Originally in the mxml, it was right inside <s:Application> not nested inside anything <s:Application> <s:Rect id="aRect" x="10" y="10" width="15%" height="15%"> //then fill code here, removed for readability </s:Rect> </s:Application> What's the deal, I thought actionscript would be nicer than mxml.

    Read the article

  • Convert a Relative URL to an Absolute URL in Actionscript / Flex

    - by Bear
    I am working with Flex, and I need to take a relative URL source property and convert it to an absolute URL before loading it. The specific case I am working with involves tweaking SoundEffect's load method. I need to determine if a file will be loaded from the local file system or over the network from looking at the source property, and the easiest way I've found to do this is to generate the absolute URL. I'm having trouble generating the absolute URL for sound effect in particular. Here were my initial thoughts, which haven't worked. Look for the DisplayObject that the Sound Effect targets, and use its loaderInfo property. The target is null when the SoundEffect loads, so this doesn't work. Look at FlexGlobals.topLevelApplication, at the url or loaderInfo properties. Neither of these are set, however. Look at the FlexGlobals.topLevelApplication.systemManager.loaderInfo. This was also not set. The SoundEffect.as code basically boils down to var url:String = "mySound.mp3"; /*>> I'd like to convert the URL to absolute form here and tweak it as necessary <<*/ var req:URLRequest = new URLRequest(url); var loader:Loader = new Loader(); loader.load(req); Does anyone know how to do this? Any help clarifying the rules of how relative urls are resolved for URLRequests in ActionScript would also be much appreciated. edit I would also be perfectly satisfied with some way to tell whether the url will be loaded from the local file system or over the network. Looking at an absolute URL it would just be easy to look at the prefix, like file:// or http://.

    Read the article

  • Ideas for jumping in 2D with Actionscript 3 [included attempt]

    - by befall
    So, I'm working on the basics of Actionscript 3; making games and such. I designed a little space where everything is based on location of boundaries, using pixel-by-pixel movement, etc. So far, my guy can push a box around, and stops when running into the border, or when try to the push the box when it's against the border. So, next, I wanted to make it so when I bumped into the other box, it shot forward; a small jump sideways. I attempted to use this (foolishly) at first: // When right and left borders collide. if( (box1.x + box1.width/2) == (box2.x - box2.width/2) ) { // Nine times through for (var a:int = 1; a < 10; a++) { // Adds 1, 2, 3, 4, 5, 4, 3, 2, 1. if (a <= 5) { box2.x += a; } else { box2.x += a - (a - 5)*2 } } } Though, using this in the function I had for the movement (constantly checking for keys up, etc) does this all at once. Where should I start going about a frame-by-frame movement like that? Further more, it's not actually frames in the scene, just in the movement. This is a massive pile of garbage, I apologize, but any help would be appreciated.

    Read the article

  • Getting a key in the ActionScript Dictionary

    - by Rudy
    Hello, I am using a Dictionary in ActionScript as a queue, sort of, still reading most of the time as an associative container, but I need one time to make a loop to run through the whole dictionary, such as for (var key:String in queue) . Inside this for loop I perform some actions on an element and then call delete on that key. My issue is that I would like to wait for an Event before fetching the next element in this queue. Basically my for loop runs too fast. I would like to fetch the next key all the time, but I know there is no built in method. A solution I thought is to add a break to the loop, as the for.. in will automatically fetch the next key, but it would be a loop which always executes one time, simply to fetch the next key. This sounds a bit counter intuitive. I hope my problem makes sense and I really look for some better ideas than what I currently have. Thanks for your help! Rudy

    Read the article

  • Embed ActionScript (AS) into flash

    - by David ???
    Hey SO, I've never dealt with Flash/ActionScript, so please bear with me. Mostly, I'm a bit confused. I've done many work with Java/C as well as HTML/Javascript. I am working with a designer who provides me with flash files (.swf). From my point of view, it's a simple "mock" to which I need to embed a single object. This object is a TextBox, with which the user interacts. I need to be able to Insert such a TextBox to a Flash file Retrieve text upon key event process it, and return it to the TextBox As I understood from other posts, I'll be working with AS, right? How do I embed such an object to an existing Flash file? Being that the graphical part is over once I have the TextBox, would I need any fancy IDE for that? What IDE is that (I usually work with Eclipse)? One last note: I am working with that designer, so I have access to all her creation process. She does not know code, nor do I think she'll get it. I would much prefer to give her as little headache as possible (e.g. just instruct her how to export the files to me from her Adobe Flash CS5 studio). Many thanks, David

    Read the article

  • actionscript-3: refactor interface inheritance to get rid of ambiguous reference error

    - by maxmc
    hi! imagine there are two interfaces arranged via composite pattern, one of them has a dispose method among other methods: interface IComponent extends ILeaf { ... function dispose() : void; } interface ILeaf { ... } some implementations have some more things in common (say an id) so there are two more interfaces: interface ICommonLeaf extends ILeaf { function get id() : String; } interface ICommonComponent extends ICommonLeaf, IComponent { } so far so good. but there is another interface which also has a dispose method: interface ISomething { ... function dispose() : void; } and ISomething is inherited by ICommonLeaf: interface ICommonLeaf extends ILeaf, ISomething { function get id() : String; } As soon as the dispose method is invoked on an instance which implements the ICommonComponent interface, the compiler fails with an ambiguous reference error because ISomething has a method called dispose and ILeaf also has a dispose method, both living in different interfaces (IComponent, ISomething) within the inheritace tree of ICommonComponent. I wonder how to deal with the situation if the IComponent, the ILeaf and the ISomething can't change. the composite structure must also work for for the ICommonLeaf & ICommonComponent implementations and the ICommonLeaf & ICommonComponent must conform to the ISomething type. this might be an actionscript-3 specific issue. i haven't tested how other languages (for instance java) handle stuff like this.

    Read the article

  • Flash Dynamic text in embedded movie

    - by Ben
    Hi I have my movie in the main timeline and then have a smaller clip in which there is a dynamic text box. In that smaller movie I have some actionscript myVars = new LoadVars(); myVars.load("http://preview.domain.co.uk/inc/loadVars.php"); myVars.percentage myVars.onLoad = function() { text_box.text = this.percentage; }; but when I play the movie it doesn't work. However if I move the dynamic textbox onto the main timeline it works. Please can someone help.

    Read the article

  • 1136: Incorrect number of arguments. Expected 0.? AS3 Flash Cs4 (Round 2)

    - by charmaine
    (I have asked this before but I dont think I was direct enough with my question and therefore it did not get resolved so here goes again!) I am working through a book called Foundation Actionscript 3.0 Animation, making things move. I am now on Chapter 9 - Collision Detection. On two lines of my code I get the 1135 error, letting me know that I have an incorrect number of arguments. I have highlighted the two areas in which this occurs with asterisks: package { import flash.display.Sprite; import flash.events.Event; public class Bubbles extends Sprite { private var balls:Array; private var numBalls:Number = 10; private var centerBall:Ball; private var bounce:Number = -1; private var spring:Number = 0.2; public function Bubbles() { init(); } private function init():void { balls = new Array(); ***centerBall = new Ball(100, 0xcccccc);*** addChild(centerBall); centerBall.x = stage.stageWidth / 2; centerBall.y = stage.stageHeight / 2; for(var i:uint = 0; i < numBalls; i++) { ***var ball:Ball = new Ball(Math.random() * 40 + 5, Math.random() * 0xffffff);*** ball.x = Math.random() * stage.stageWidth; ball.y = Math.random() * stage.stageHeight; ball.vx = Math.random() * 6 - 3; ball.vy = Math.random() * 6 - 3; addChild(ball); balls.push(ball); } addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void { for(var i:uint = 0; i < numBalls; i++) { var ball:Ball = balls[i]; move(ball); var dx:Number = ball.x - centerBall.x; var dy:Number = ball.y - centerBall.y; var dist:Number = Math.sqrt(dx * dx + dy * dy); var minDist:Number = ball.radius + centerBall.radius; if(dist < minDist) { var angle:Number = Math.atan2(dy, dx); var tx:Number = centerBall.x + Math.cos(angle) * minDist; var ty:Number = centerBall.y + Math.sin(angle) * minDist; ball.vx += (tx - ball.x) * spring; ball.vy += (ty - ball.y) * spring; } } } private function move(ball:Ball):void { ball.x += ball.vx; ball.y += ball.vy; if(ball.x + ball.radius > stage.stageWidth) { ball.x = stage.stageWidth - ball.radius; ball.vx *= bounce; } else if(ball.x - ball.radius < 0) { ball.x = ball.radius; ball.vx *= bounce; } if(ball.y + ball.radius > stage.stageHeight) { ball.y = stage.stageHeight - ball.radius; ball.vy *= bounce; } else if(ball.y - ball.radius < 0) { ball.y = ball.radius; ball.vy *= bounce; } } } } I think this is due to the non-existance of a Ball.as, when reading the tutorial I assumed it meant that I had to create a movie clip of a ball on stage and then export it for actionscript with the class name being Ball, however when flicking back through the book I saw that a Ball.as already existed, stating that I may need to use this again later on in the book, this read: package { import flash.display.Sprite; public class Ball extends Sprite { private var radius:Number; private var color:uint; public var vx:Number=0; public var vy:Number=0; public function Ball(radius:Number=40, color:uint=0xff0000) { this.radius=radius; this.color=color; init(); } public function init():void { graphics.beginFill(color); graphics.drawCircle(0, 0, radius); graphics.endFill(); } } } This managed to stop all the errors appearing however, it did not transmit any of the effects from Bubbles.as it just braught a Red Ball on the center of the stage. How would I alter this code in order to work in favour of Bubbles.as? Please Help! Thanks!

    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

  • Obtain reference to View in ActionScript class within ViewNavigatorApplication

    - by chb
    I've got a very simple project in FlashBuilder 4.5. It's a mobile application of type ViewNavigatorApplication with a single view, MapView. In the MapView.mxml file, I've got a Flex component of type Map declared in xml. <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" name="CatBusMapView"> <fx:Script> <![CDATA[ import com.esri.ags.Map; .... ]]> </fx:Script> <fx:Declarations> .... </fx:Declarations> <esri:Map id="cbm"> ... </esri:Map> </s:View> In this same project, I've an actionscript class called UserGeolocation. In this class, I'm attempting to get a reference to this map component. So far, I can get a reference to the top-level application, its ViewNavigator and the NavigationStack of said ViewNavigator. However, I cannot find a way to access the MapView, much less the map I've declared within it. I'm aware of methods like firstView() and activeView(), but I want an absolute solution, one that retrieves the view regardless of whether or not it's first or active. I've tried navigator.getChildByName("MapView") with no luck.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >