ActionScript 2.0 :: Make A Test With A Class Menu?
Jan 9, 2009
I was trying to make a test with a class menu, but I have 2 problems: one is I can't change the name of menu, like home, links, contact, and other one is the pictures on line, I can't see them into the boxes. [URL]
I purchased an elastic menu flash component that uses AS3. Unfortunately, I've only just waded into AS2.I'm trying to replace the generic colored background with an image that is masked. Unfortunately, turning the layer into a mask breaks the functionality. The weird thing is that it works fine in Test Mode (Ctrl+Enter) and if published as an EXE. It just doesn't work as an swf.Has anyone run into this weird inconsistency before? Also, what is the best way to get into that component and possibly modify it?
I am working on a DVD User Interface for my final project in Photoshop. For extra credit points I am trying to figure out how to make the menu items to light up when the pointer is touching the menu icon.
I need a tutorial for a hierarchical drop down menu system that drops down 3 sub levels. Do I make the items in the sub menus individual buttons and then insert them into a movie clip or make every sub menu item a movie clip and insert them into buttons?
Im trying to make a menu for a web page using menubar and menu components, is ther any way of making os specifing that the menu can get drawn out of the canvas, since i need that the bar is thin for getting in a space betwen to image headers.
In my platform game my character shoots bullets from a gun,these bullets are loaded from a 'bullet' class. A new instance of this class has the variable name 'bulletVar'. I can adjust the bullets x and y position like so:
bulletVar.x = 253;
But I also want to use it in a hitTestObject, I thought that the following code would work, but it does not!
stage.addEventListener(Event.ENTER_FRAME, hitEnemy); function hitEnemy(event:Event):void { if (bulletVar.hitTestObject(enemy_mc))
[code]....
Here's my code to call a bullet:
var bulletVar:bullet = new bullet(); this.addChild(bulletVar);
I have a test.fla with a document class associated, say DocTestClass.as. Normally I load the test.swf and DocTestClass is automatically instantiated. But I'm curious. What if I make some other instances of DocTestClass, with pure code, without loading the swf? What are the implications or possibilities?
In fact these questions in turn come from another original question: is it meaningful to make a document class a singleton? Or a document class (as I suspect..) cannot be instantiated more than once and so it's implicitly a singleton?
Im tring to remake most of my projects that i've created so far in class's and packages but it seems to be a mission.
I have the gameMain_Controls class which is the linkaged to the actually fla. then i have a custom cursor class and a char class the gameMain_Controls pulls objects into the stage as children of the background fron the char class.
now my problem is to get the cursor to hittest of mouse over and at least do a trace out put:
code im trying at the moment which is also in a different class ...called the rollOver_Controls:
if (flap_Control.flap.hitTestObject(Dino_Control.layla)) { trace("lal hit"); }
[Code]....
but the hittest jsut never occurs im guessing the problem is which the location of the object, the container i mean ...but when i try to link it that way i get even more problems
Basically I'm trying to use localConnection to determine if two or more instances of the same swf are running. If I set this code up on the main timeline of the fla it works:
ActionScript Code: var conn:LocalConnection = new LocalConnection(); conn.client = this; try {
How can I test to see if the Class of an instance is the correct one? Say I have two Custom Classes, Circle and Square. How would I make it so that if the class of instance one is Circle, a specific function is carried out?
I have created a website with 3 pages One of the pages has a scrollbar that scrolls images inside a masked box.I created its functionality with 2 classes externally, the scrollbar and scrollbox movieClips are linked to these classes in properties.Now it scrolls when I test the fla,but it fails to scroll when I test the whole website.
>the classes are in the same directory as my project
I'm wondering if there is a method to do a hit test object between two movieclips from the same class. The movieclips are being spawned into the stage using a for loop.
Is it possible to if(item(event.currentTarget).hitTestObeject(item(thats not being selected at the moment?))) I'm doing a drag and drop game and am trying to not let the items stack above each other when dragged to the snapping slots on the stage. If not is there other methods avaliable?
I've created a simple Flash based menu (ONE frame, 7 layers) with a Keylistener on the first frame of my "background" layer. I have it setup with six links/buttons. Clicking a button opens that URL. And in "Test" mode from the Flash Editor, pressing 1 thru 6 on the keyboard launches the specified link as well.
But after I publish/upload my file, it no longer detects any keystrokes. I suspected this was because the animation was playing just one frame and stopping, but the animation is set to loop. I also tried adding a second frame and adding a "gotoandplay(1);", but that didn't work either.
Code: KeyListener = new Object(); var myKey; KeyListener.onKeyDown = function() { myKey = Key.getAscii();
I'm trying to make a simple test for my current project and I have som problems with Vector class. I'm assigning BitmapData to the MovieClip and store this MovieClip to an Array. Then I'm able to access BitmapData.If I do the same but use Vector instead of Array class, I get this error if I want to access BitmapData:1119: Access of possibly undefined property bitmapData through a reference with static type flash.displayDisplayObject.
Code: //var store:Array = new Array(); // - THIS ONE WORKS! var store:Vector.<MovieClip> = new <MovieClip>[]; var itemBitmap :Bitmap = new Bitmap(); itemBitmap.bitmapData = new BitmapData(100, 150, false, 0x990000);
I've been trying to make my a simple RTMP player test. It seems to be getting the link, but not actually playing the video.
Here is the code:
Code: var connection_nc:NetConnection = new NetConnection(); connection_nc.connect("rtmp://video.njspeakup.com/vod/ppd"); var stream_ns:NetStream = new NetStream(connection_nc);
[Code].....
The onStatus is tracing back info, but like I said, nothing is playing. I have a videoPlayer on the stage with the name my_video. The FLA is attached. (CS3)
I'm trying to test a custom Flex 4 skinnable component, using the FlexUnit UIImpersonator class. If I run my tests from a FlashBuilder Spark only project everything works fine. If I try to test from a project with the mx component set on the classpath I get a "getElementIndex not available in non Flex 4 projects" error.Can I unit test spark components in FlexUnits visual test environment while still having the mx component set on the classpath?
UIImpersonator delegates it's method calls to a "testEnvironment".The implementation used for this "testEnvironment" is decided by the VisualTest EnvironmentBuilder class and the FlexEnvironmentBuilder class. If the FlexEnvironmentBuilder class can find the "mx.core.Container" on the classpath it returns a MX environment, else a Spark environment. Only the spark environment has valid implementations for Flex 4 relevant method calls on the UIImpersonator - like the addElement method.
My buttons only work when I click on them on the stage while having the "enable simple buttons" option on. They do not work if I try to "test movie," "test scene" and publish it to a SWF. Nothing responds whenever I am in these modes. I am using Adobe Flash Professional CS5 Actionscript 2.0.
i have a movie that has worked fine in past during Html test but ive been doing some dubugging using the flash test latly and it runs fine here but when i go back and try to test in Html mode no errors come just the movie never fully starts (starts up about as much as if there was an error).
I have two scenes in my flash file and in scene 1, first button takes you to frame 2 where movie clip is -works
on (release) { gotoAndStop("scene1",2); } second button takes you to frame 3
but on scene 2 that performs same function as scene 1, the first button
on(press){ gotoAndStop("scene2",2); }
instead of going to frame 2 goes to frame 3. and the second button goes correctly to frame 3.that happens when i test scene! when i test movie all buttons work properly.
I wanted to make a xml menu, and I followed the technique of hga77 xml menu - hga77 I managed to put all the code in one frame, but I still have a "little?" bug, that I can't find... When you look at my example, and you click on "Technieken" (=Techniques)and then on "Info", the subitems are not always positioned in the right way. Another time the "Technieken" come to stand under "Info"... weird...
In FlexUnit 1 it is possible to access the name of the currently-running test using the TestCase.getName() method because all tests subclass TestCase. In FlexUnit 4, however, there's no base class for tests; the tests are identified by annotations. So, how can I replicate the getName() functionality in FlexUnit 4?
I want to know how to make class instances into listeners and broadcasters, from inside each class. Here is what I am trying specifically... part of the Proj class... (projectiles, as a matter of fact)
Code: private function listen():Void { u.register(this); onUpdate = function(){ step(); // a function I have which makes the projectile move (not shown) } }
where "u" is another class, the Updater class with this code...
Code: class Updater { // const. --- make this a broadcaster public function Updater(){
[code]....
PS: What is the syntax for using AS2 code tags instead of just "[CODE|"?
I have built a basic preloader that runs in my document class. I'm having trouble with it.I'm guessing its due to what a class can and can not access from the stage?theres 2 problems. the first is that I cant change the keyframe the stage is on from the class. the second is im getting an error 1009 if I comment that out.