ActionScript 2.0 :: Movieclip Prototype Not Responding?
Oct 20, 2004
I have an org chart that looks like this:
click to see
Anyway, there are 130 little boxes on that graphic, each one a movie clip. Because I want the same thing to happen on rollover of each movie clip I have put the following on my main timeline:
*edit* Another small problem - since the movie clips aren't all the same size the code MAKES them all the same size if you roll over them in quick succession. How can I prevent this? Is there a better way of capturing a particular movieclip's starting width and height, double it on rollover, and then returning to that on rollout?
I'm trying to create a fairly simple website entirely in flash. I have navigation on the left (Home, and Shapes) and when you click on Shapes, two things change: my main content called mcContent (which is a movieClip) changes to its second frame (called shapes) and you see a few shapes. Below the main content is another movieclip called mcBottom which does something similar, goes to it's second frame (called shapes) and you see two shapes, a red and green square.The problem is that I want the user to be able to click the red square and have the red square movieclip called mcRed go to it's second frame (called mcRedContent) but it doesn't work. I believe it has something to do with the hierarchy of my objects but I can't seem to figure it out. The error that I get when compiling is:Code:TypeError: Error #1009: Cannot access a property or method of a null object reference.at trouble_fla::mcBottom_4/frame1()Here is a link to the fla:
In a ActionScript 2 code sample it uses some MovieClip.prototype's functions, as MovieClip.prototype.setModel;I'm trying to write this example using an ActionScrip 3 class, but the MoviewClip.prototype does not exists, where can I get it from? Does it exists in ActionScrip 3?
--update as you are asking, here goes, this code works just fine as an actionscript included on frame1, but I want to make a ActionScript 3 class with this same code:
//package //{ // public class asteroids extends MovieClip // {
am finishing up the Friends of Ed Actionscript for Flash MX.At the end they show using MovieClip.prototype. Is this depreciated or not best practice? I was planning on moving onto FOE Object-Oriented ActionScript.
How can I use setInterval in movieClip.prototype? This code increase num value just one time... MovieClip.prototype.testFunc = function(num) { var num = isNaN(num) ? 0 : num; trace(num); clearInterval(this.slideDelay); num++; this.slideDelay = setInterval(this.testFunc, 4000,num); }; var testMc = _root.createEmptyMovieClip("testMc", 1); testMc.testFunc(0);
I'm trying to make this script work which has a function to enable buttons.
// This script is on a seperate layer frame: // webnav, iden, adv, mult are instances of MCs btns = [webnav, iden, adv, mult]; MovieClip.prototype.enableBtns = function(btns) {
[code]....
The buttons disable but just don't enable again when other buttons are clicked.The button instances are on the path: _root.navbtns_mc.
A Flash program is connecting to WCF web service hosted on a server without anti-virus and without firewall and windows server 2003 64 bit environment.[code]...
im using this method to load movies and create transitions between them for my site.. I have read the technique thoroughly and im fairly sure the code and structure I have used is correct however the loadMovie function called from an embedded swf is not doing anything and I cant work out why..on the main timeline there is a container movie that the swf files are loaded into, the intro sequence is loaded through an action on frame 1:
this works no worries.. but when the container is targeted from inside the introsection.swf movie nothing happens, this is the code used:_root.container.loadMovie(_root.currMovie+".swf")I have tried variations with this and nothing works.. the container movie has the correct instance name and the code works from the main timeline but not from within another swf.
My flv files won't run if I move the folder where I have all the contents. How do I fix this problem so that I can run the flv's no matter where the folder is? I know this isn't exactly an actionscript problem since I imported them directly to the library and from there to the stage,
I have content in a scrollpane which I would like users to be able to drag (content is larger than the pane). There are also rollover areas in the content that are only accessable when scrolldrag is false (makes sense). So, I've set the scrollpane scrolldrag property to false until the user presses the Ctrl key:
//Listener for Ctrl key to allow drag createEmptyMovieClip('_keyListener',999); Key.addListener(_keyListener); _keyListener.onKeyDown=function(){ if (Key.getCode() == 17) {
I have some code that draws a line that follows the mouse and fades away over time, until now it was in the main file of my program but i want to make a class out of it for later use in other programs. I edited the code into a singleton MouseHandler class with one function that registers the mouse up and down events; with trace and 'hasEventListener' I found out that the events are registered but nothing happens when I press my mouse buttons.
Here is the class package { import adobe.utils.ProductManager; import flash.display.DisplayObject; import flash.display.DisplayObjectContainer; import flash.display.MovieClip; import flash.display.Sprite; [Code] .....
In my main class I just use MouseHandler.getInstance().startListening(this);
I'm debating two approaches to a pretty typical problem: Knowing when an event occurs or responding to it immediately if it already has occurred. In approach one, a user of MyLoader1 adds an event listener which will be fired immediately if the loader is already complete.
class MyLoader1 extends EventDispatcher { private var _isComplete:Boolean = false; public override function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void { super.addEventListener(type, listener, useCapture, priority, useWeakReference); [Code] .....
What advantages/disadvantages are there to each approach? Is there a design pattern out there that I could/should be using for this situation? I'm leaning towards the first because it requires less knowledge of the Loader class and less code to leverage it. It could potentially create unwanted side effects when there are multiple listeners though, because the event will fire once for each time a listener is added. The second method is understandable and easier to debug, but requires more up front work and seems to break encapsulation of the Loader.
I have Adobe AIR application that uses many swc's, i facing a blocker that when user dont interact with my AIR application more then half an hour and when user return back, the application not responding, i aslo try backgroundFramerate=-1, but no avail.
How do you set up a funtions to run only when two or more listeners have been activated?For example: if one listener is waiting for a file to be loaded and another one is waiting for a display object to fade out.I want to get the object starting to load but also want to start the image on the stage to fade out at the same time.I want a new image to start to fade in but not before the new image is loaded and the old image has faded.
So I usually don't post in forums because I can usually find the answer to my question online. But I have been messing with this for days with no success.
Import AS2 version of swfaddress into flash movie... check. Place SWFAddress.js file into webpage... check. Call SWFAddress.setValue("home")... not check!
I'm working with CS4 and AS3 using timeline coding. I have three sets of movie clips in three different arrays. The idea is to have topArray and downArray movies make zeroArray movies visible. For instance, if topArray[0] and downArray[0] are clicked, then r0_0 becomes visible. PROBLEM: r0_0 becomes visible when EITHER topArray or downArray is clicked. How to make r0_0 wait until BOTH top and downArray movies are clicked?
ActionScript Code: // //movie clips holdings results -- all invisible var zeroRow:Array =[r0_0, r0_1, r0_2, r0_3, r0_4, r0_5, r0_6, r0_7, r0_8, r0_9, r0_10]; for (var a:int=0; a<zeroRow.length; a++) {zeroRow[a].visible=false}
I'm fairly competent with AS2, and I've been using it to code an interface with in flash CS5 (I know, I need to embrace the AS3, but I don't have the time right now).Anyway, I hit a little snag. I've got a video container symbol, inside which there is a video player, which is animated with a fade in/ fade out animation on the frames of the video container. On the first frame of this symbol there is a "stop();".What I want to be able to do is use different buttons in different symbols and frames around the flash file to set variables, which the video container can then read and fade in appropriately.
I've already got the buttons to set the variables I want it to. Each button will set the contentPath of the actual flvplayer, and set a "vp" variable to 1(_global variable). In the video container's first frame, I've told it to gotoAndPlay frame 2 when _global.vp == 1 - However, the video container won't read the vp variable when it's been stopped.So what am I doing wrong? how am I supposed to get the video to fade in on the click of a button, which will also set the contentPath of the video?
I want to scale the Text in a TextField to 80% width. Problem seems to be that TextFields don't respond to ScaleX. and ScaleY uniformly scales the whole TextField. Does anyone know how I can accomplish scaling the text to 80% width? And I then need to use that TextField as a Mask for a gradient (I know how to do that), so the route of using a TextBlock doesn't work.
Currently making a music project that will, in theory, play sounds based on detected colors a webcam can see.I'm certain this is possible in either AS 2 or 3 - but unsure exactly how.I've searched the wonderful nets for a tutorial or an example of this being done with flash but have come up with nothing.Is there any tutorials for detecting colors and then responding to them? (All as viewed by webcam, so in real-time).
I have 25 textboxes on stage. I am using a for loop to point to each textbox and evaluate the contents. When I come across a textbox that has the letter "Y" in it I want to place an object called colorbox at a certain location. To do this I have assign the value in each textbox to a variable called tf and then evaluate the variable tf to see if it contains the letter "Y". When I trace this variable outside of my if statement it correctly shows the contents of the current box, however within my if statement it doesn't. Also the colorbox doesn't get placed at the designated coordinates and I get the following error message:[code]
I downloaded an flv file using RealPlayer 11 (latest version), now when I play it back within my custom made video player, it plays fine untill it reaches the end. I have programmed the video player to go back to the beginning onComplete.
I have tried other flv files and they work just fine - could the flv file be corrupted.I need a resolve on this issue today, as I have a client waiting to approve of the custom video player. Also, he wants me to use the same player on some of his client sites.