ActionScript 2.0 :: Prototype Align 5 Different Mc's / Swf's
Jan 9, 2005
ive made 5 diff codes to give the right positions on my mc's. but the code is all hanging on the mc's. Now i was thinking 2 put all code into 1 keyframe. So i think i need to write a prototype of it. It will be great if somebody out so i can understand more about how 2 write my own prototype for this. The file is just for study for me to play a bit with aligning mc's on stage. The code that is hanging on the clips are:
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 // {
I am using a software to load my swf in the TV and I can get basic functionality without problem. My issue is with creating a menu slider that is x and y sensitive without using the Xmouse or any mouse related property. This has to function within D-Pad Navigation and with a standard TV remote. I have had some success with using an invisible button (loaded with a script) to make the menu "move". This way doesn't allow much control.
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.
Why wont work this prototype ?I dont understand it.You can download the fla hereWhat do it need to do: When you roll-over a piece of the skyline it need to resize to that defined number.I putted the code in a for()-loop.
I'm trying to make an educational app prototype (I'm new to Flash, this is for a Masters in education) to help students learn IPA symbols (phonetics). I have successfully made a section where the students click on symbols to hear the corresponding audio and listen to explanations.
For the final part of the prototype, I have to create some kind of instructional game. My idea is to have 12 circles, each one playing an audio file of a vowel sound (this I know how to do). The students will have to click the circles to listen and then drag and drop them to the correct IPA symbol. Flash would then give feedback on correct/incorrect answers and a score. Maybe all of this is against the clock, needing a timer.
So, I need to learn drag and drop. What else to I need to learn so that one drop position is considered "correct", the others are considered "incorrect" and a score is given at the end? And maybe a timer?)
In Flex, you can add functions to the prototype of a Class; but how do you add a setter? For example, with A some (non-dynamic) class, you can do this:
var o:Object = new A(); A.prototype.myFunction = function():void{trace("foo");} o.foo();
And that will call the foo function. But how could you add a setter, so that setting the property calls the setter (just like it would if you declared the setter in the "normal" way on the A class). So what I want is something like this:
PS: Manipulating the prototype is an unusual thing to do in Flex, and not something I'd recommend in general. But for the sake of this question, just assume that there is a reason to dynamically add a setter.
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 my first prototype, but I can't put it to work, I wanted to atribute a property to a variable, so I could call the prototype on to the movie clip, asking for any property, without having to change the prototype code.Is it possible?Here is my code so far:
MovieClip.prototype.multProp = function (proper,targetv, smooth) { this.proper -= (this.proper-targetv)/smooth; };[code]...
I'm trying to write a prototype function that will use setInterval. The following script defines a simple movieclip prototype that traces the clip's x position when called. The function works fine when called explicitly ( _root.foo.trace_x(); ), but does not when called by a loop.There are three clips on the stage, their instance names are foo, man, and chu. I created an array so I could loop through and have each one run the trace_x function once.Here's the code:
I created a prototype function for the Array object. It's supposed to load and parse an XML file, then take all the values from the XML file and convert them to objects, which I then want to push to the array that called the function. However, I can't seem to get it to work.The function itself seems to work, but the push to the array does not. (code below)
Array.prototype.xmltoArrObj = function( path ) { var xmlurl:String = "nav/" + path + ".xml"; var attr:String = "";
i've made a function prototype to make a "type-like" effect... but when i want two textfields to use the prototype at the same time, it ****s up! its like its only possible to use a prototype on one movieclip... not two movieclips at the same time...
I'm using the following code to set a prototype for hitTest within a loaded mc. It works great the first time, but I need to test to see if it's been called because it doesn't work if the code gets called on successive loads...
Is there a way to test to see if the prototype has been called before? I was setting a variable in the _parent movie initially, but I can't do that now so I need to test to see if the prototype has been called...
I've got a menu with 3 menu items. Each item is a mc. There is a pointer mc that eases to the mc menu item that you mouseover. That was working fine...until I found out that I have to make the menu dumb enough for flash 5. As we know, you can't assign button events to mc's unless using flashplayer 6 or higher. So I tried to just drop some invisible buttons over my menu item mc's and assign the mouseover events to call the prototype in each invisible button. The prototype should then ease the pointer mc to the position of the menu item that I've moused over. Problem is that it restarts the playhead back to frame 1 each time I mouse over a button.
The function is called on release of a movieclip. I'm making a drag a drop navigation and there are two content windows .. "h1" and "h3".
I don't think there's anything(much) wrong with my code itself, I'm just having trouble with calling anything within h_ins.onEnterFrame. Is there a fundamental issue that I'm not aware of? Below are all the details if you're interested.
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 am trying to make a small hangman game using mostly AS. I have it set up so a word is randomly chosen from an array and then lines and text boxes are dynamically created depending on the number of letters in a given word. My problem is the AS to check to see if the letter from the input box matches a letter in the word and then output "lucky guess" or "guess again" depending on whether there is a match or not. Also, if the guess is wrong, the count variable increases by one (to keep track of the number of wrong guesses) and then goes to the corresponding frame to draw the hangman. I hope this makes sense. Here is the code I have for checking the letter from the input box to the letters in the word.
submitis the movie clip button the user presses when a letter is typed into the input box.If you input the very first letter of the word then the code recognizes it as correct. Any other letter, whether part of the word or not, is given a "guess again". Count never seems to go above 2.
What I am trying to do is to make a prototype apply to only certain movieclips. For example..I have one apple movieclip and one orange movieclip. For these I have two prototypes: [code]But I don't want the apple prototype to apple to the orange movieclips and the orange prototype shouldn't apply to the apple movieclips (they will overrun eachother).How can I accomplish this, without adding code to the specific movieclips, and WITHOUT doing like this:[code]
I'm still working on my scrolling product bar, and it works great when I publish in flash 6 or higher, but prototype does not work when I publish for flash 5.
Here something i'm applying what i used the prototype to. Just some random flash just to keep on learning new things. **excuse the [color] stuff, idk where that came from but thats not in my actionscript..**
Code: for (x; x<5; x++) { _root.dot.duplicateMovieClip("ring"+x, x+1);