ActionScript 2.0 :: Cannot Use OnRelease In A Class
Sep 27, 2011
I am trying set up a simple onRelease function of a button in AS2 within a class file but this is not allowed. It's been ages since I have worked in AS and have a client who needs some work done by a previous developer. why I cannot just use myButton.onRelease = function ()....Here's a sample of the AS2 snippet
Code:
public function callFunction(functionString:String) {
var functionItems:Array = functionString.split(",");
var functionName = functionItems.shift();
I have a "onRelease function" CODE: btn_4.onRelease = function () { var yTween = new mx.transitions.Tween(slider, "_x", mx.transitions.easing.Strong.easeOut, slider._x, 695 , 0.600000, true); } This works good but I like to add in a "onRelease" play sound, too. How it have to look like and where do I have to place the sound? Because: When I add in a new function "onRelease" both block each other.
I have a Red Cup which is a MC and I want the Red Cup to go UP when clicked on and goes back down when you release the mouse click. I know the coding is On(press) { and On(release) { But I do not know the details.
I'm writing a program that has a button, and when pressed, and the shift key is pressed, will do an action. I have an onRelease function for that button also, but for some reason when I have the button pressed, and I press shift or any other key, it automatically thinks the button is being released. I was using the onMouseDown, onMouseUp functions before, but they caused me a lot of problems aswell.
Try it for yourself:
Code: btn.onPress = function() { trace("pressed"); //now hit a keyboard button }
I have two buttons. Each one calls in an external swf. I would like one of them to call it in onRollOver but nothing happens. It works fine when I change it to onRelease.This is the code I have for the two.
Code: // Instantiate MovieClipLoader Class var thumbloader:MovieClipLoader = new MovieClipLoader(); case_btn_1.onRollOut = function() {
I need help with onRelease after using loadMovieClip function. onRelease doesn't work on duplicateMovieClip. The code:function buildGallery (page Position)[code]
I would like to push a value, anything really, into my array when my movieclip is pressed. I have a number of fish movie clips, and when I press them they unload, but I would like for every press of the movie clip instance a value to be pushed in the array. This is so that when a certain number of fish have been pressed the movie goes to the next frame. So, I give an if statement to say if the array has a certain length, go to nextFrame();.[code]
I am designing and coding a navigation menu at the moment, and so far I have got the button instances to duplicate for each of the menu items, and set widths, positioning values and RollOver/RollOut functions. However, I would ideally like to include the onRelease button functions in the for loop too - as they are all the same apart from the variable "i". Here is the code snippet:
ActionScript Code: for (i=1;i<(_root.noofmenuitems+1);i++){ duplicateMovieClip("mc", "mc"+i, i);
[code]...
Now my problem is that by the time the onRelease function is called, the for loop has been completed and the value of i returned is the last i value from the loop (_root.noofmenuitems+1). The this["mc"+i] part obviously works, because the trace function is called when I click any of the menu items.The problem is that I have 6 menu items, and when I click any of them, the trace function returns "test 7" - not the corresponding i values for each button.
Have been dabbling with flash for few years, but would like to send data to external PHP file and would like flash to process response.The way I have it working is to register function for the submit button on the main stage where I have the form instance. However, when I do this, it stops rollover effects from working on submit button. (The button is actually a movie clip instead of straight forward button btw.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ Form code below: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
I am having a hard time trying to use an onRelease event handler inside a for loop. Basically, I am developping a custom player for articulate presenter using flash and AS2.This code is generating a movie clip in a for loop for each line in the sidebar, with slide title and slide number parsed from a XML.Until here, all works fine.But when I try to generate the onRelease event handler to play the wanted slide when I click on the line, the value inside the onRelease is always the highest value of i.Looks like the onRelease evaluates i only when I click on the line, after all the clips have been generated.[code]I have to find a way to capture the value of i for each clip.
Im trying to create a xml gallery for her images. The slideshow is working but they want a button on the stage that when clicked, it will go to the last image in the xml file.
I have a serious situation regarding the onRelease Funciton not working properly.I have a FVLplayback componant inside a flash project inside a movie clip. Inside that movie clip I have two layers, One for actionscript and and the other for the actual component which contains instance name of 'myPlayer' (without quotes)[code]That cameraRoll is the instance name of another movie clip I have located in the movie clip as shown in path above. Inside that movie I have rollover, Rollout effects. The actionscipt is in an invisible button right on top of the objects. The actionscript is:[code]The objective: the movieclip to carry out the rollover Rollout effect and to have the function that will start the video.The Problem: When I run the flash project, it does the effect but won't start the video. If i move things around, I can have the video start playing but then the button won't do the rollOver, RollOut effects.
-the path to the video component:-root.menu.video
-the path to the movie clip taht contains the timeframes for rollOver/rollOut effects )which contains invisible button on top of everything. root. menu.cameraRoll
I'm using duplicateMovieClip to create instances of a clip. Then I use an array to name the clips. In the scrip that duplicates and names them, I also have an onRelease function to make the mcs do something when you click them. I can't get this onRelease part to work. I need to:[code]
- swap the depths - load some text - attach a movie from the library
I'm trying to have a bunch of buttons generated in a for loop, and I want the onRelease function defined so that each button has a unique e-mail address attached to it.As it stands now, all the buttons are being assigned the last e-mail address in the XML file. I've got more code in my actual file that creates text fields on top of the buttons, and they're displaying the correct info, so it's only the onRelease function that isn't working...Here's the abridged code:
var xmlPeopleList:XML = new XML(); xmlPeopleList.ignoreWhite = true; xmlPeopleList.onLoad = function(bSuccess:Boolean) { if (bSuccess) {
I need the following script to run as soon the as the play head comes on the frame. Right now it is activated through an onRelease...need to replace that:
myButton_btn.onRelease = function() { tweenBall(mx.transitions.easing.Strong.easeOut); }; function tweenBall(easeType) {
I have a loop to create clip buttons w/jpg images on face && load same jpgs into main viewer clip. Problem is, the mc buttons won't respond to onRelease.
for(i=1;i<3;++i) { var mc = "mc"+i; // button mc clip names