I'm trying to make a flashlight effect that automatically (not mouse controlled) goes over the text and image (all on the image) and then have the flashlight beam fade then open completely to the 900x400 image and stay visible...
Any good demo or tutorial on creating a hollywood style spotlight effect? 2 soft edged rays pointing down towards a 'floor' and criss crossing each other.
I cant get a spotlight effect with gradientfill to work right i create an object that represents the gradient and then i tween it from small to huge... and draw a box the size of the screen and fill it and on each updateMovement I redraw the gradient with a alpha 0 center and a 255 edge...but it doesnt center right at all...no matter what i do. It always is off Center...(oh Im using Stage.width/height since it needs to be dynamically resized based on browser...)
Right so I was just wondering how I would go about creating a 'spotlight' effect on an image in flash. I want to use a background image which is only visible within the 'spotlight' (e.g. everything outwith the spotlight is just black). The spotlight must be able to be controlled by the user (I know how to do that bit at least)
Realistic FLASH spotlight beam, not using a circular mask. I am in desperate need of some information, about realistic spotlights designed with flash. I need the kind that shoot a beam with a round circle on the floor. I have found a great example, at http://www.grisu.com and the owner even shared the fla code with me, but I still don't quite understand how to modify it to work for me. He offered to help, but he only speaks spanish and I only speak English, so we can't communicate.
If you go to his web and view the stage, the beam sweeps the stage and changes the angle and size of the beam. I need a longer and narrower beam. The length of the beam is too short for me, but the idea is just what I need. Does anyone know of any tutorials on this subject? Or possibly other samples so that I may study them in detail.
1. Is a mask necessary to keep all the beams the same length as they scan? As the angle changes, the beam length would change unless a mask or something cuts them off at the floor level always.
2. Motion tween could probably be used to move the beam?
3. Would it be necessary to skew the beam as it sweeps as when it is slanted like that, the width of the beam gets wider as it sweeps away from you and more narrow as it sweeps closer to you.
4. Did you need to use alpha anywhere possobly when the beams cross each other or maybe when it is first turned on?
I would greatly appreciate any advice anyone can give, or steer me in the correct direction for some tutorial information.
Realistic FLASH spotlight beam, not using a circular mask.I am in desperate need of some information, about realistic spotlights designed with flash. I need the kind that shoot a beam with a round circle on the floor. I have found a great example, at r even shared the fla code with me, but I still don't quite understand how to modify it to work for me. He offered to but he only speaks spanish and I only speak English, so we can't communicate. If you go to his web and view the stage, the beam sweeps the stage and changes the angle and size of the beam. I need a longer and narrower beam. The length of the beam is too short for me, but the idea is just what I need.
Does anyone know of any tutorials on this subject? Or possibly other samples so that I may study them in detail. 1. Is a mask necessary to keep all the beams the same length as they scan? As the angle changes, the beam length would change unless a mask or something cuts them off at the floor level always. 2. Motion tween could probably be used to move the beam? 3. Would it be necessary to skew the beam as it sweeps as when it is slanted like that, the width of the beam gets wider as it sweeps away from you and more narrow as it sweeps closer to you. 4. Did you need to use alpha anywhere possobly when the beams cross each other or maybe when it is first turned on?
Migrating to AS3 is being harder than I supposed, because the way things are referenced. I have a stay movie clip instantiated from library like this:
Code:
var mcMyMain:MovieClip = new mcMain(); addChild(mcMyMain); var mcMyChild:MovieClip = new mcChild(); mcMyMain.addChild(mcMyChild);
Within mcMyChild I have a timeline with some animation, and, at the end of this timeline I want to instantiate another movieclip in mcMyMain (that is in stage) like this:
Code: stop(); var mcMyTest:MovieClip = new mcTest(); stage.mcMyMain.addChild(mcMyTest);
I would like to know if its possible, to use a string in order to create a UI element.I think many people have this kind of problem, they want an easy setup in flash to generate a dynamic UI, through code.It should look like this (pseudo code):
addToStage("Button","add"); addToStage("TextInput","name"); private function addToStage ( o : Object, str : String ) : void {
I keep getting this error: Incorrect number of arguments. Expected 0.Probably just something stupid... but I'm struggling...I have two classes (ribostrand.as and nucleo.as) in a folder called architect. The main FLA file is outside the folder.I'm trying instantiate the nucleo class with parameters, from the ribostrand class... but its not working.
var ribo:nucleo = new nucleo("A",50,50) < code moved to the next thread and reformated >
I have been trying to get buttons to work when linking back from an html page to a frame in a .swf movie for a couple weeks now, I have searched exhaustively to no avail. I am out of resources, I have searched every variation of the issue in multiple places and just cannot find an answer.
In a nut shell, when the "home" page (.swf in an html container page published with html anchors) runs first time all is well, buttons function goes to certain frames no prob. But once the links go out to another html page, and then back to the frame in the .swf, all links properly back to correct frames, but then the buttons don't function anymore. The closest I have gotten to solving this is it was mentioned that the mouse event code is not instantiating for some reason that I cannot understand.
The code IS on all the fames that are in question, but just will not work after linkback.
Is it possible to instantiate MovieClips that exist in the library (that have been exported for actionscript) with a for loop using an array that holds their link name?
var fruit:Array = new Array("apple", "banana", "blackberries"); for (var i:int = 0; i < fruit.length; i++) { var aFruit[i] : fruit[i] = new fruit[i]; }
As simple a problem as the title says. I must be doing something really stupid. I've got a large section of a site, built a month ago runs fine. Went to make some changes. Now when I compile the video instantiantion fails. I've gone back to basics to test this problem out and it persists.So, here's my document class:package sections{import flash.display.MovieClip;import flash.media.Video;public class LocketVideo extends MovieClip{private var _vid:Video = new Video(200, 200);public function LocketVideo() {trace("hi there");}}}When I compile the swf I get the following error:/Projects/[omitted]/Src/sections LocketVideo.as, Line 9 1137: Incorrect number of arguments. Expected no more than 0.( line 9 is the _vid line )Now, if I pull out the parameters of the video object it works fine... well compiles fine. A video object without a size isn't much use. Note that if I don't set parameters... all other calls to the object fail.My first thought was that my default Flash classes got corrupted. Nope. Ran this compile on two other computers, same issue. Also thought maybe I had the fla set to the wrong .
I was chatting with my buddy about this, he is convinced you can do this and says he has done it, but I cannot get this to work.
I am wondering if it is even possible at all. I tried typing a var as a Class that is within the externally downloaded SWF and then making an instance but no can do.
some code
private static function onCompleteHandler(e:Event) { dashboardObject = e.target.content; // registerClassAlias("Dashboard", ); doesnt work
[Code]....
So it seems you cannot make an instance of a class unless it is complied within the project SWF. Which if true is what I want it to do. I do not want people trying to make instances of my classes just from downloading the SWF file for what I am building here.
I have an abstract class which gives specific 'base' behavior to multiple sub classes. I want to instantiate a Singleton inside this abstract class. Is it good practice to:a) instantiate a class within an abstract classb) do this with a Singleton (I know these may be frowned upon)For clarity I will give an example, the method instantiating the Singleton is:
public function createErrorRepository(repositoryType:String):void { this._errorFactory = ErrorFactory.getInstance(); this._errorRep = this._errorFactory.createErrorRepository(repositoryType);
How can I instantiate a TabViewNavigator from actionscript for the playbook? Currently, I add the necessary spark frameworks and have this piece of code in the Main of my actionscript project:
[SWF(width="1024", height="600", backgroundColor="#ffffff", frameRate="30")] public class Main extends Sprite { private var waitDialog:BaseDialog = new BaseDialog (); public function Main() { super (); [Code] .....
When the button is clicked, the button disappears as you would expect but the tab navigator is not added/does not appear. I tried without removing the Main class but that does not work either. What do I need to do to set up a tab interface. I can get similar code working through Flex and MXML but not in actionscript.
when you have some kind of module for a website for example, what is a better way to code you application?If i load external swf, then i obviously need to compile it before from fla, but i can have some symbols in the library directly in that fla file.if i make an instance of a class, then i dont need swf file but then i need to take care of library stuff (if any) differently...
I've got a large section of a site, built a month ago... runs fine. Went to make some changes. Now when I compile the video instantiation fails. I've gone back to basics to test this problem out and it persists.[code]...
I am trying to change over old code (Actionscript 1.0) to use Fuse in Flash 8. Old code uses: this._x = Math.easeInQuad(this.t, 0, gox, 6); So my new code in Flash 8 would be:
I have some classes: LowA, LowB, LowC, SpaceShip, that all subclass BaseChar. How can I instantiate one of the subclasses by using a string for the name. (I have been trying to get this to work for a couple of hours now). For example, the typical way that I have been instantiating the subclasses:
To call a class we would type: var testClass = new TestClass();Can I store the class in an array, and somehow pull it when I want to call it the same way? I need to be able to call a new class like the example above, but from an array.
I'm rewriting a game that came from AS2, and passing it to AS3. The problem is that I have several different MovieClips in the Library, with a sequence name ("s_0", "s_1,...).
how can I use the addChild to instantiate these movieclips, using these names, sequencially, using a FOR loop?
I'm trying to get a way, that I don't have the remake all movieclips, or else I'll be stuck on the desk for a week :P
i'm trying to create a dynamically named Vector. i have a critical project deadline tomorrow, and this small problem is holding back continued development i've adapted my code from this example [URL]...yet am getting an error message (see below). here is what i have:
I made a Post-It note movie clip that is draggable. I want to create a whole pad of notes, or at least simulate this. I thought the best way to do this would be to add another Post-It whenever the startDrag() is triggered.
I first tried creating the Post-It with symbols but didn't think I could dynamically create new ones this way. I then created a class and added it to the stage[code]...
How can I instantiate another class object from a class instance? In the code below (which doesn't work) I'd like the function to return a new class instance based the passed argument's class. In other words, I want the function to return a new instance of MySprite without having to call new MySprite();.
var mySprite:Sprite = new MySprite(); var anotherSprite:Sprite = makeAnotherSprite(mySprite); function makeAnotherSprite(instance:Sprite):Sprite { return new getDefinitionByName(getQualifiedClassName(instance)); }