ActionScript 2.0 :: Function Activated If Move XPos 450?
Mar 11, 2005
I've got this button that sets _xdest = 450. What I am trying to do is set an If move._xPos>= 450 then a function is activated like this
move.onEnterFrame = function() {
if (_root.move._xPos>= 450) {
out();
}};
View 3 Replies
Similar Posts:
May 29, 2004
I have a mc on the stage. I want the mc to move from one x position to another x position and back to it's previous x position again, after a button is pressed.I have the following function:
Code:
function moveClip (clip, xPos, speed){
clip.onEnterFrame = function (){[code]....
Is this the right function to accomplish what I want and if yes, what should be the action for the button?
View 4 Replies
May 29, 2004
I have a mc on the stage. I want the mc to move from one x position to another x position and back to it's previous x position again, after a button is pressed.[code]is the right function to accomplish what I want and if yes, what should be the action for the button?
View 4 Replies
Jan 3, 2012
I am working with AS3 to build a very simple mp3 player on my site. So far the play and pause button work fine, but when I try to move the slider then click the pause button, it doesn't pause, and then clicking the play button again causes it to play a new file.I'm assuming that for some reason when I call the playMp3 function from my MouseEvent, it's within an object or something and not at the root, so it's like loading a new sound file, but I don't know how to fix that.URL...
View 2 Replies
Dec 6, 2007
I am using the mctween activated bttn.My bttns are looped and have been defined in a variable.I am trying to get specific onrelease functions such as loadMovie from each button in the loop depending on what bttn is clicked,but instead the onrelease functions is loading movies for all when any bttn in the loop is clicked.Heres my code.
Code:
// Includes the tweening extensions.
#include "mc_tween2.as"[code]....
I'm trying to make sure that if the user clicks, this.button_2 then this.button_2 will load movie2.swf alone not every movie for every bttn in the loop.
View 1 Replies
Feb 19, 2011
[code]The idea was that xpos would update every time the button is clicked, and go from 250 to 300 to 350, etc.I don't really understand why xpos doesn't update; it always remains 250, except for within the function (when it temporarily goes to 300.)
View 9 Replies
Nov 2, 2006
making an object move from one side to another by using actionscript. so now i was wondering how to make the box get back into the same place as it started when it reaches a certain point.
dding the code to this AS i already got:
Code:
onClipEvent(enterFrame) {
speed = 5;
this._x += speed;
}
View 3 Replies
Jan 29, 2003
is it possible to write a function to move an object and then call that function on a clip event for instance
function (bounce){
script;
script;
}
and then call it by saying
on(mouseOver){
this.bounce;
}
View 2 Replies
Sep 19, 2009
The "size" is 1200x800 pix, and here is were the problem is. When a person look at the site with a 1280x800 or smaller a bit of the site is not there. I don't want to resize the file, so i thougt that the easiest way to solve this problem were to input a scroll, but I can't get the damn scroll activated. Do i need a huge actionscript or is it as simple as mark somewhere in publish (when you create the html-file) need answer as fast as possible.
View 2 Replies
Sep 22, 2011
I have an object that has been added to the stage, exported properly for actionscript, and given an instance name.It's class file is this:
PHP Code: [code]....
And yet none of this works. The trace doesn't even go off, meaning the constructor is never activated. It's linked properly; if I go to the movie clip's preferences and hit "edit class file" it takes me to the proper one.It's possible that the problem lies with the frame numbering. The first time this object is added to the display list is in Frame 2...and it says "export in Frame 1" but I'm not exactly sure what that means or how it affects the class definition or how to get around it. I tried adding it (var sb:SoundButton = new SoundButton in the first frame,
View 3 Replies
Mar 27, 2012
I have a motion tween user icon (UImovingM1) moving from one point to another when I add its child. Once that user icon gets to the exact x and y coordinates that I want, I want to go into another function where that child (UImovingM1) is removed (along with a background) to add a new background. Now my small problem is that when I get into my goToMoneyTemp function, where the motion tween user icon is added, it plays the movie of the user icon moving over and over again. It will not go into my goToMoney function.[code]...
View 3 Replies
Jul 24, 2009
I'm trying to figure out how to get buttons to be activated by keyboard presses. I have found how to do that with specific keys ... but not with ANY keypress. I'm making a game for tiny children and they can't manipulate the mouse well. So I'm setting up a few things on stage that will run in a certain order when the child presses any key on the keyboard. For example, any key is pressed, dog wags his tail .... any key is pressed again, cat jumps, any key is pressed a third time, cow munches hay, and so on till it goes through a bunch of animal animations, then goes back to the first one. I'm pretty new at this stuff and have been banging my head against google for days trying to find the answer to this out there with no luck! I could do either movieclips or movie clips inside buttons if that makes sense.
View 1 Replies
Feb 3, 2010
When the user mouses over a button, it brings up a menu. I want the user to be able to click things in that menu that pops up, but of course when the user moves the cursor off the button and onto the menu, it deactivates the button and the menu disappears. Is there a way around this?
View 3 Replies
Jun 5, 2009
I'm trying to create a scrollpane that is activated by a button. I've already created the scrollpane and linked it up with the text I want, I just need to know how to make the button activate it.
View 15 Replies
Feb 21, 2012
anyone got an idea of how I can create sound or voice activated animations? What I want to do is set up a microphone so when a viewer speaks, a movie will either activate a sound clip or an animation?
View 3 Replies
Aug 13, 2009
I have a mc that when clicked moves off screen, however when it starts to move, once the mouse cursor is off it, it moves back to its original position because my onOut event is to have it move back to the original position.
How do I avoid the onOver activating after the mc has been clicked?
(p.s. - I'm wanting the button to also lead into the next frame and to never be seen again).
View 2 Replies
Jan 19, 2009
I'm creating a platform game, and I want the character to hit a button which would take them to the next level (keyframe).
I want it to work like a normal button, except for the character on the screen, on contact with the button to transport into the next keyframe, rather than the user having to click the object.
Also, is there anyway to do this while at the same time (while changing to the next keyframe) keeping the score, so it adds up with the next levels points?
View 4 Replies
Jul 8, 2009
I am trying to have a link on a web page open up a flash video that appears to hover over the html. I have read web pages explaining parts of this but I cannot get it all to work together.
I am using swfobject to embed the flash object into the web page. I think I need to use javascript to handle the event of clicking on the button and then use z-index to have it appear to hover. Ideally the flash would center itself in the middle of the browser
View 1 Replies
Aug 13, 2009
I have a mc that when clicked moves off screen, however when it starts to move, once the mouse cursor is off it, it moves back to its original position because my onOut event is to have it move back to the original position. How do I avoid the onOver activating after the mc has been clicked?
View 3 Replies
Jun 5, 2009
I want to have pop-ups activated on mouse over of a button in my all-Flash website. By pop-up, I mean in the same browser window. Just a small window that comes up with a small amount of content related to the respective button. How do I do this?
View 4 Replies
Mar 17, 2011
I made this menu : my menu
I am looking to make an improved and more advanced version of the same menu.
I made an animation of waves on the cofee's surface and am looking to make it loop when the mouse is moving and to stop looping when it's not.
View 2 Replies
Jan 27, 2009
I'm designing a countdown timer that starts when you press a button.There are 4 buttons altogether in which i placed preset values like say, 5,10,15.20 mins.You get the drift.and it is supposed to start counting down from there.
However,when i press the button,it just gets stuck at a certain number e.g 4:58:49 and it doesnt count down.My actionscript is written like the one below.i don't understand why it doesnt work.A
stop();
start_time = getTimer();
_root.five.onPress = function () {
countdown = 300000;
[Code].....
View 1 Replies
Oct 5, 2009
I have a button in a movieclip. Mc is activated by an invisible btn, on the timeline.... I want the btn "thumb6" in the movieclip to go to the frame called "img1", which is placed on the timeline also.
View 5 Replies
Nov 1, 2010
I have a button on my page and when I click it, I'd like a sendAndLoad event to happen. The button's instance name is button. I'm not sure how to get the sendAndLoad to be activated when the button (in this case a submit button) is pressed. I know that sendAndLoad is with the LoadVars class so I'm not sure it can even be called within a button actions. Here is the sendAndLoad I'm trying to use:
[Code]...
View 7 Replies
Feb 21, 2011
I m creating a project of maze game in which have to use keyboard event. All the coding is done in as3 and i m using swc files in my project. When i published the swf, it shows me intro screen then it goes to game screen when i click on play button. Then the game screen gets loaded (i did addChild for this as i m using swc for each screen). Now the keyboard event should capture when any key is pressed. For this i wrote :
Main.STAGE.addEventListener(KeyboardEvent.KEY_DOWN , pressSpaceBar);
Main.STAGE is a static variable stored in another .as file.
But the event is not firing on loading the game screen. It fires when i click anywhere on screen(screen selection).
Why this is happening ? and why the keyboard event is not firing ?
View 4 Replies
Feb 20, 2010
package {
import flash.display.;
import flash.events.;
[code]....
View 1 Replies
Feb 10, 2011
I need to create an animation and provide some results of the move function at the END of the animation. However, i am not able to control the output till the move function is completed
I tried the isPlaying- that doesn't seem to detect that the animation is completed... so continues to output resukts before the animation is complete
sample code I tried
private function mvbut():void{
var mv:Move= new Move;
mv.xFrom=Math.random()*300;
[Code]....
View 1 Replies
May 14, 2004
Alright so... I really don't know the best way to approach this. I had a LOT of code that I thought could be generalized into a function. I don't know how to explian it... here is the code:i attached it...I know it's a lot of code... I just... I don't know what to do with it anymore! When it was in a bunch of small functions, it worked (sort of) just seemed reallly messy and annoyed me.Oh btw its causing the hero to jsut go to 0,0 and then a hit symbol appears there, and then nothing happens, the hit doesnt even dissappear.
View 7 Replies
Jan 6, 2010
I have a file with 3 movie clips and three buttons that control them to play...with the script below It is working fine.
stop()
function startImageOne(Event:MouseEvent):void [code]......
View 4 Replies
Mar 30, 2012
i'm trying to make a zoom in and out of a movieclip when certain event is activated, anyone knows a way of doing this? i tried with mc.scaleX++ or mc.scaleY++ (i tried with mc.scaleX+10000) but nothing happened.[code]
View 1 Replies