ActionScript 2.0 :: [Flash8] OnRelease Function() With Unique Ids
Sep 27, 2006
I have the following code that lists 5 buttons with dynamic texts... when pressing each button a popUp_mc window will appear with some content show in dynamic text. Only one of these 5 buttons have some images that will have symbols_mc appear... in this case I just alpha this symbol to 100 only for this button, but for the rest alpha = 0. The button the I want to show the symbol is the third one. I'm a bit confused on how to show this symbol according to the following code below.
i have a movieclip on the main timeline, and inside that mc I have 1 button on first frame and 1 button of second frame...From the main timeline i run this script for frame 1 button...
And this works fine.. however, i run the exact same script for the button on frame 2, ofcourse changing the path and gotoAndStop(1) instead... And this isnt working.. The button's over frame works so its activated...
I have a mc that you should drag to the right mc.The mc that you have to choose from are sometimes a little close so I made a code that the mc that you drag will xscale so it will be smaller.But then if I press on the end of the mc before dragging the mc is outside the mouse and you cant use the OnRelease code.How to avoid that.Enclose a small fla, and the code is:
function god ( t,t1,t2){ t.onPress = function(){ this._xscale = 20;[code].......
Its suppose to create a Movie called container which has a text field in it then when the container movie clip is clicked on "Goodbye World" pops up in the trace window.So far the only thing this code does is display "Hello World" but no action is taken when it is clicked on.
Code: var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth()); var label:TextField = this.createTextField("label", 1, 0, 0, 150, 20); label.text = "Hello World";
When I press the button nothing happens, but when I remove the attach code and just put the button on the stage with the appropriate instance name it does work.
I have a movie that uses a next and previous button. The next button works the same on every page calling a function that uses next(). The movie continues until it is told to stop. The previous button takes you directly to a specific frame in the movie. When running through and testing, if I go forward a frame and then back to the beginning and then add a frame every time, it seems to work fine. But if I go forward 3 times and back 2, or mix it up in any way, the previous button will only work once. Then after that you can go forward as much as you want, but you can only go back once. Each frame that has a previous button has a unique function.
Here is my code below: stop(); import flash.ui.Keyboard; import flash.events.KeyboardEvent; stage.addEventListener(KeyboardEvent.KEY_DOWN, Next); Next_btn.addEventListener(MouseEvent.CLICK, Next); Previous_btn.addEventListener(MouseEvent.CLICK, Disclosure2); [Code] .....
What I'm trying to do is setup a function that shoots through a set of buttons within a subset and creates click code for these buttons.
THe three variables are the identifiers for the actual keyframe i wish to jump to, the movieclip in which i want to perform the action and the actual button to go to the right frame.
Presently the problem I'm having is that the variables aren't stored when the onRelease functions are created, so they all are just calling the LAST variables declared.
Here's a sample of the code I currently have
Code: //function to load canvas/acrylic function setSwatches(mySwatchCount:Number, myContainer:String) {
I need to make each item in my XML unique so that flash can apply a different function to each item in the component. Can you give the items an instance name in XML?
Code: import com.digicrafts.events.*; //Timer Set Time var jumpTimer:Timer = new Timer(1000, 1);
each of six buttons need to pass a unique file name to an asp page... below is the code for the six buttons... obviously this won't work, but it give you an idea of what i need to happen...
So, I have tons o' buttons that each need to link to unique URLs, and I'd like to minimize coding as much as possible. The code below works, but I will have to do this about 50 times.Can I associate the URLs with the instance names of the buttons and then reuse the same function?In the event you didn't already guess, I'm a newbie to AS3
cap_mc.CapTeam_btn.addEventListener(MouseEvent.CLICK, capPage); function capPage (evtObj:MouseEvent) { trace("clicked") var url:String = "http://www.mydomain.com"; var request:URLRequest = new URLRequest(url);
I need help with onRelease after using loadMovieClip function. onRelease doesn't work on duplicateMovieClip. The code:function buildGallery (page Position)[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.
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 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:
Just getting up to speed on looping and incrementing variables. A real time saver.I have a onRelease function that I would like to apply to several button objects:
I need the p variable as well as the target but1 to increment. This is my first attempt:
for (n=1; n<=23; n++) { phase1a.but[n].onRelease = function() { p=[n+1];[code].......
I get a good trace on n showing that the incrementing is successful but nothing on p when the button is clicked and no execution of the function thisImage(). Not getting any errors either. Can you not loop an onRelease statement?
I am working in CS4, but using as2 as the publish setting since the swf I need to load in was previously done in as2.I have an interface that I am loading a logo.swf into. This logo has animation that works properly both in test and in the browser. There is, however, a function in the logo.swf that is not working.
When I test with the IDE this is clickable within the interface, but when I view via the webpage it is not. AllowScriptAccess was set to sameDomain, but I have also tried that set to always.
I can't get my getURL to work. It works when I use "_blank" but not when I use "_self" or "_parent" or "_top" or leave it empty. I've got it right off the main timeline. I've also tried putting it within an onRelease function.
So, this doesn't work: Code: getURL("images/aboutus.jpg", "_self"); But this does: Code: getURL("images/aboutus.jpg", "_blank");
Strangely enough I can't access the variable i in the onRelease function below. I guess it must have something to do with the position where I declared it. But I also tried to declare it outside of the functions but it didn't work either.. how to solve this problem?
I have this function on "mc".And I would like to call the function on ''mc" without clicking on "mc". How can I create the state where this "mc" is being pressed by script on a frame or another button?
I have some script for a sliding gallery and buttons to move the images. how to change the function from onPress to onRelease so I can animate the button.
I have another question about my For loop. 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: