ActionScript 2.0 :: Press The Corresponding Movieclip?
Jun 21, 2006For some reason I can't get it to populate my text box when I press the corresponding movieclip. Can someone take a look and help me out a bit?
View 1 RepliesFor some reason I can't get it to populate my text box when I press the corresponding movieclip. Can someone take a look and help me out a bit?
View 1 Replieswhen i press TAB, the selection goes to another movieclip, instead of the next text field.i read a lot of threads, but could't fix this bug,
so far (after lots), i got this code:
[AS]
var textAR:Array = ["nome_txt", "contacto_txt", "email_txt", "morada_txt", "pais_txt"]
var textCounter:Number = 0
Selection.setFocus(textAR[textCounter]])
[Code]...
excuse the lazy question but I'm tired of google I have been trying to learn about repositioning movieclips on the click of a button. So basically, the movie clip will move to a location on the screen in accordance to the browser size and relevant to the button pressed.
I have seen a few tutorials that move an object say, 100 pixels. But what I want is for it to move into the top left, or top right, or bottom middle of the screen regardless of the browser size.
I'm working in Flash CS4 and I would try to do it in AS3 but my teacher isn't very familiar with it, so I've decided to do it AS2. But so far he hasn't been able to, that is why I AM DESPERATELY coming to you.
I want to be able to PRESS A and play the movie clip that goes with it.
I want to do this with the whole alphabet.
Press A play movie clip APage
Press B play movie clip BPage - and so on....
I have attached my fla. I want rotate the mc by Mouse drag. But its get some of the jerk.
View 1 RepliesI am trying to get a movie clip to pop up when I press a button, when the clip pops up it displays certain information taken from an xml document. I want to be able to display the info held in the first part of the xml to display when I press the 1st button, the info in the 2nd part of the xml to display when i press the 2nd button and so on. However it always seems to loop to the last item in the xml list. I have also posted my actionscript code below:
import mx.xpath.XPathAPI;
var popup_xml:XML = new XML();
var popupArray:Array = new Array;
var popupNames:Array = new Array;
popup_xml.ignoreWhite = true;
popup_xml.onLoad = popUpFunction;
[Code] .....
Suppose there is a button on stage - on press - I want to [display / start to run] a movie clip present in library (should i place it on stage?) I tried:
on (press) {
loadMovie("one_mc", "1");
}
not working.
I am working on dynamic duplication of movieclip when the button is pressed one by one. In that movieclip there are two buttons ok and cancel.
Here is the piece of code:
var new_panel:please_wait = new please_wait;
click_btn.addEventListener(MouseEvent.MOUSE_DOWN, generate);
function generate(e:MouseEvent):void{
new_panel = new please_wait;
[Code] .....
if I create two movieclip, then how i remove a particular movieclip. I also attached the screen shot for reference..
Attachments: Screenshot.jpg (138.9 K)
I have a round movieclip ( like a ring or clock ) and i want to press and drag it to rotate it around it's center ( AS3 ). I tried hundreds of ways but none of them works perfectly. I think i miss something in trigonometry and flash's rotation concept.
View 8 RepliesI'm trying to do is use a keyboard event to play a whole movieclip once then stop once the animation sequence is over. However, when I press the corresponding key, all it does is play the animation for as long as the key is held down. What I want it to do is play the whole animation when you press the key just once.This is my code:
ActionScript Code:
import flash.events.KeyboardEvent;
var space:Boolean = false;
stage.addEventListener(Event.ENTER_FRAME,doNothing);[code]..............
I have a problem with the rotating cube tutorial (link below):
[URL]
I'm trying to give an action to each face of the cube. I would like to make it a menu with 6 buttons (one per face)I want to launch a movieclip each time i press a face.
i have an issue with some startDrag objects. I am using this code:
[Code]...
problem is:
1 - Sometimes i just cant target it, no idea why (i imported the Ai files and then just hit F8 and make it a movieclip)
2 - Sometimes, when i press the movieclip goes to strange coordinate
How can i make it so a when you press a button it starts a countdown but every other press dosent reset it?
View 14 RepliesI have neither the capacity nor the integrity to overcome as3, how to build a system wherein if I were to press movieclip instances in a certain order, would move me to a certain frame if I did. I am trying to do this without making 100 eventlisteners and relying on an array instead. If I could say anything about how as3 is about implementation of values, I'd say it's a bit like using the titanic to deliver a piece of cheese on toast, but I guess what I need to know specifically is
How to make a function that relies on a certain set of array values.
How to splice that entire array after the array reaches a certain number of values.
How to move to frame 2 if the array does possess the correct values.
How to stay on frame 1 if it does not.
So far I have
var inacertainorder:Array = new Array();
var i:*;
i = 0;
function toframetwo(event:MouseEvent)
{gotoAndPlay(2)};
if(inacertainorder[i] == "0,1,2")
{stop();}
else inacertainorder.splice[i>3]
{gotoAndStop(2);};
I made a movie clip, with a button inside. When you roll over the button it takes you to frame 2, and on roll out back to frame 1. On press you go to frame 3. Similar to a button. It also attaches a white fading shape over the button on roll over. This button/movie clip works fine.
But when I try to add:
(playbutton_mc_inst = the movie clip button)
Code:
playbutton_mc_inst.onRelease = function() {
gotoAndStop("level01");
}
The roll over, roll out and press commands don't work when I add that.
I have a menu bar as a movie clip and another movie clip acting as a slider. I want to on pressing a button on the Menu bar movie clip get the slider to slide across with easing. however I don't want the easing to be infinite so can't use a this._x*=.9 or some decimal < 1. Loop function only acts on the single frame so it too quick to see.
View 1 Repliesi have an image inside a movieclip, with the alpha set to 30%. Now I'd want to be able to change the tint (like Hue from Photoshop) of that movieclip on button press. I figured it might be possible by creating a new movieclip, putting a transparant square in it and changing the _alpha and color on buttonpress, but isn't it possible to do directly change the tint of the movie with the image inside with actionscript ?
I tried senocular's method [URL], but my movie turned all pink instead of red transparent.
i'm looking for a code for a keycombmanager in AS3, if anyone have played the advergame from cokezero, you have to press a certain keycombination the movieclip kind of jumps to and play another frame, that's the kind of kombination i'm looking for. [URL]
View 1 RepliesI have a problem when I making a game Flash with action script 3,. I want tomake my character move when the key helding and I want my character attackwith one tab press either
View 3 RepliesI have text field which is 0 by default (score_txt)Two buttons +1 and -1 (plus_btn and minus_btn) When I press +1 text increases by one, and when i press -1 it decreses
View 4 RepliesI've wrote this code...
Code:
function makeTree(xmlLoad:String) {
import mx.controls.Tree;
[code].....
I got a "huge" problem.. or should I call it "lack of knowledge"...The thing is, I'm building a homepage in dreamweaver. But the menu itself is made in Flash.The problem is:hen I press my button I want it to load the animation on the button first (the button is a movieclip) then go to the link (homepage)
View 6 Repliesi have an object that i want to drag and drop with the same event.Something like on press start drag and on press again stop drag. I'm sure it's pretty simple with and if and else statment but i can't find how to do that...The best i have done so far was this:
[Code]...
How can I use two key at a time :
I wrote this code for single key ....
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, moving);
function moving(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.RIGHT)
[Code].....
I am making something that requires me to have a key pressed. I tried using the Code: if (Key.isDown(Key.thekey) But the key I want does not show up. I want to use the a,s,d,f,g,h,j,k,w,e,t,y,u, keys but they don't show up so I don't know how to make that happen. on a letter keypress. I also would like to know how to make it do something on the key release. I am using flash CS3 and ActionScript 2.0
View 3 RepliesI'm able to detect (at the most) two simultaneous key presses via a switch statement and series of booleans. For my game's sake, I need to be able to detect up to 4 keys.
Here's my test script:
var key_37:Boolean = false;
var key_38:Boolean = false;
var key_39:Boolean = false;
[Code]....
i have a MC with 2 MCs inside. [MC1 & MC2 for arguments sake] When MC1 is clicked i want MC 2 to go to the next frame. //code on mc1 onClipEvent(enterFrame){ on(press) { _root.MC2.nextFrame(); }} just 1 of the trial and errors ive tryed how do i do this ive tryed many different combinations and on different movie clips but nothings happening for me :S
View 7 RepliesI know how to make a button and all.. but what do I do to make it go to the next scene?
scene 1: Startsidan
scene 2: Sidan
I made a frontpage and when I click on the picture I want it to go to scene 2, where it enters the inside.
the button is called PortalenKnappen, I want to be able to just press on it and it will go to the "sidan(scene 2)" that's empty at the moment.
what would I have to write? I've tried "portalenKnappen.onPress nextScene("sidan", 1"); but it doesn't work.
I'm wondering if there's a way to temporarily disable keyboard shortcuts in Flash? The problem is that some key presses don't register when I'm testing a movie in flash because flash itself registers the key. For example pressing "B" while I'm testing a movie activates the Brush tool but doesn't trigger an event in the actual movie. When I publish the movie and try it in a browser it works fine.
[Code]...
In my game the Superhero walks around the screen by pressing some keys. But between the moment you press the key and the moment the moment the Superhero starts to move there's a slight delay.
View 5 Replies