I am using a custom java exception to provide the flex client with more info than the exception itself. My exception extends Exception and it has a attribute with the needed info for the client. Well, my problem is the following: when I build my exception if I invoke super() or super("message") the flex client can access all the info properly. But if I build the exception with a Throwable cause, super(cause), then the flex client can only access to stackTrace.
public class MyException extends Exception { private String errorCode; public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { [Code] ......
By using MyException(String msg) the flex client can access to errorCode By using MyException(Throwable cause) the flex client can't access to errorCode
In the flex side the code is: var faultEvent : FaultEvent = FaultEvent( event ); var errorMessage:ErrorMessage = faultEvent.message as ErrorMessage; var codeError:String = errorMessage.rootCause.errorCode;
My goal with this actionscript is to create a new movieclip for each top-level XML node and include in the movieclip two separate textfields, an image, extend the movieclips to two row if necessary, rotate each movieclip differently depending its parity and add a hover event based on the movieclips instance name. I have achieved each goal except for the hover bit. The reason I cant access the instance name outside of the for loop is because the instance name only lasts for duration of the loop. Here is my current code (at pastie address).
This is the third thread I've written for my current project (1st was answered perfectly, 2nd failed [but I still figured it out anyways]) but I'm not sure if there is a solution to this problem. I can't really explain my problem, so once again I've included a helpful animation to show you what I mean. Bear in mind that the pale-blue box represents the movie clip's borders, and those borders are usually changed to include the animation (instead of the borders moving with the animation, the borders get bigger).
For the animation problem, I've already got a solution: create an invisible movie clip that has the exact size and shape of the animated movie clip and make it follow the movie clip as it animates, and make the hitTest check the invisible movie clip instead of the animated one. As for the rotation problem, well, I don't know how to fix it. Is there a way to change that?
I want to create a movieclip class that subclasses another movieclip class and inherits all its properties (rather than having to rely on the include statement). In my project I'm using:An abstract parent class that extends a movieClip: "infantryDroid".[code]However everytime I try this, flash acts as though nothing was imported from the parent movieclip class.If I was to try the above code I would get the message that _root and speed (which were defined in the parent class) "are undefined".
I want to create several "buttons" (which are actually MovieClips) that are all identical apart from an image and the link. My thought was to create a movieclip button that contains a var that will represent a movieclip, then in each instance of the movieclip button set that variable to be the movieclip image that will correspond to the button.
Geez my query seems so simple until I try and put it into words...The gist of it is, how do I name a movie clip variable? Something like, in the main movieclip, instead of inserting a specific image into the movieclip, insert a variable named innerImage, then in each instance of that movieclip name the image to be inserted by specifying the variable
var innerImage:MovieClip = the movieclip I want for this instance. If the var was a number, it would just be: var innerImage:number = 4; If the var was a string: var innerImage:string = "word"; So for a movieclip: var innerImage:MovieClip = ???
Which will look through a 2 dimensional array, then I need to create a new MovieClip for each value in that array, using something like this:
Code: var mc:tile_mc = new tile_mc();
Except it needs to make more than one of these movieclips (all with different names), and I need to be able to pass to movieclip name through the drawTile() function, or have some way of knowing what it is for the current loop..
Is there some way that I can like make the name of the movie clip "tile_" + yt + "_" + xt ? Since yt and xt change every loop and I'm already passing those values through drawTile
Basically, on my stage, the user can select a bunch of different weapon parts and each 'part' has its own movieclip. Once the user has customised a full weapon, I need to give them the ability to convert the entire array of parts into a single movieclip so that I can then use that generated weapon (move it around in a game) without moving the individual parts around.
In my fla file, I created a movieclip in library which links to class MyMovieClip. I add some functions in the class. I fla file, when I drag the movieclip to stage, all the functions are working well. But I want to dynamic create the movieclip in stage(not dragging from library). This is the codes in my first frame of fla:
var tf:MovieClip= new MyMovieClip(); addChild(tf);
but all the time it display those error information: TypeError: Error #1009: Cannot access a property or method of a null object reference.
at MyMovieClip() at dragExample_fla::MainTimeline/frame1()
anybody can tell me what the problem is and how to dynamically create a movieclip which link to a class.
How to create a movielclip, and then put an external file into it (picture or swf). I first need to create the movieclip var holder_mc:MovieClip = new MovieClip; Next I defined where the file is filelocal = "somegalaxy/far/far/away"
This is where I hit the wall, I seen examples where I need to add a listener , others just looked like they added the child. I went the simple (wrong) route and tried just using the addChild. Complied, but nothing addChild.holder_mc (filelocal).
What I'm trying to do is create 8 movie clips that I will load different images and dynamic text into using XML. I understand how to work with the XML but what I can't figure out is how to create different MovieClips that house the different images. This is what I have so far:
var thumbHolderArray:Array = new Array;function addThumbs():void{ for (var t:Number = 0; t < 8; t++) var greyMC:MovieClip = new MovieClip(); this.addChild(greyMC); greyMC.name = "greyMC" + t;
trying to make an empty movieclip, but after compile the file i press ctrl+L to see the objects instances on stage, it shows only Level #0: Frame=1. how can I make myMC movieclip???
package {import flash.display.Sprite;import flash.display.MovieClip; public class drawCurve extends Sprite { public function drawCurve() { var myMC:MovieClip= new MovieClip(); addChild(myMC); myMC.name="MC"; }}
In my actionscript program, I draw a polygon using the methods : this.graphics.moveTo() and this.graphics.lineTo(), and in the update function of the polygon model I change it a bit, and then draw it all over again. Eventually, every call to the update() function draws the updated polygon and I can see it changes.
On some point of the program, I want to be able to use this polygon as a movieclip, so I can attach a mask to it - so as the polygon drawn over and over again, I could see a nice background in the form of that polygon, fills it inside.
Problem is - I do not know how to take this array of points I have, which is my polygon representation, and turn it into a movieclip ( if possible at all... )
ActionScript Code: var listaVideo:XML = new XML(); listaVideo.ignoreWhite = true;
[Code]....
this is my listing and what I need to do is to create dinamicly movie clip instances to point diffrent web sites for every node of my XML file and I'm stuck...
my XML file looks like this:
HTML Code: <?xml version="1.0" encoding="UTF-8"?> <videos> <video url="http://www.hau-miau.pl/cyber_minotaur.flv" title="video1"
I'm attempting to create a new MovieClip and add sprites in using actionscript, the issue is i want them to form an animation and so would have to add the sprites on different frames.
The code I have I thought would work but then I realised you cant gotoAndStop further than the last frame that currently exists within a MovieClip - so all my objects are on the frist frame of the MovieClip. Meaning that I'd have to create frames when creating the new MovieClip.
ActionScript Code: var mc:MovieClip = new MovieClip(); for (var i:int = 0; i < tilesForClip.length; i++) { mc.gotoAndStop((delay * i) + 1); var tile:Bitmap = drawTile(tilesForClip[i]);
On frame 1 new fla and I type the following code: [AS] createEmptyMovieClip("clip1",0); clip1.createEmptyMovieClip("clip2",1); [/AS] I have tried over and over again to get this to work but it won't! I want to create an empty MC and then create anoth MC within the first!
I can create a MovieClip using the follwing process:
1. Select rectangle tool from ToolsWindow and draw a rectangle by dragging through mouse.
2. Then press F8 by selecting the drawn rectangle, select radio-button with "MovieClip" and click "OK".
3. Now give the instance-name to this newly created Movieclip(say,myMovie). Now, we are able to use this MovieClip.
But, I don't like to use this process and I like to use ActionScript 3.0 code as a sole to create a custom-sized MovieClip(here, size depends on MovieClip's "width & height" properties) upon which I need to place as many no. of text-fields( say, "n")& "n" value is known dynamically upon requirement. Hence the MovieClip size must be increased/decreased as per our requirement depending on "n"(i.e., no. of TextFields.
And my code writte in "Actions" panefor changing the MovieClip's size dynamically upon requirement looks like this:
HTML Code: myBtn.addEventListener(MouseEvent.CLICK,onSubmit); function onSubmit(evnt:MouseEvent):void {
1.) I need ActionScript 3.0 code to create a Rectangle shape which must be a MovieClip. So, I need to pass/access MouseEvent_CLICK events on this MovieClip.
2.) Now, this newly created MovieClip(or rectangle) should not be created with same/static size always. Instead, it's size is dependable on some value(say,var index:int).
In this case, I think it is better and good programming practice to write the code for dynamic-sized MovieClip in a user-defined method(say, createDynaMovieClip()).
I need the full requirement in ActionScript 3.0 code format only.
I got struck up with this problem and the sample code which I developed till now is as shown below(which creates the required rectangle):
Code: import flash.display.MovieClip; var rectangle:Shape = new Shape(); rectangle.graphics.beginFill(0xF3FAB8);
I want to be able to create a movie clip on the fly, inside another movie clip, not duplicate, but create an instance of a clip that only exists in the library. The movie clip that the new clip must be created in is going to have a loadMovie already applied to it, so anything existing in it will be removed. I need a way to insert a clip from the library into this parent mc. I tried attachMovie() but its not seeming to work.
Im making a website and in frame 1 on the main timeline I have mouse down code for a button in a movie clip not yet on the stage (it appears when a mouse_over event is triggered).[code]How do I create links for menus that arent yet being shown on the stage?