ActionScript 2.0 :: CS4 - Simple Button Script Not Working?
Apr 14, 2010
I've got a really simple script that on a button click, changes the alpha of a set of mc's from 0 to 100, then on second click changes back to 0. The first click works fine but for some reason the second click isn't working. The button needs to stay "on" as well so I've got the buttons in a mc with named frames "on" and "off". Here's the code:
Code:
Actionscript Code:
ltBlueButton_mc.ltBlueOff_btn.onRelease = function(){
[code].....
View 3 Replies
Similar Posts:
Sep 21, 2009
I have got a simple button in the first frame of my flash file, but its not wokring. Here is the code I am trying.
Code:
Btn.addEventListener (MouseEvent.CLICK, myFunction);
function myFunction (e:MouseEvent):void {
trace("working");
}
It gives this error: "The class or interface 'MouseEvent' could not be loaded"
View 3 Replies
Nov 4, 2009
I am somewhat new to Flash CS4 andt am having a problem making simple buttons in Flash CS4 on a Macintosh: I have made a few buttons with a graphic and can go into them and successfully create the Up, Over and Down stages of the graphic. Then when I create a new box for the hit state (which is larger than the graphic and I have deleted the graphic itself from the hit state) it doesn't want to appear correctly when I test the movie. When I test the movie, the hit state is correct everywhere around the graphic (to the bounds of my hit state box), but is not active where the graphic is.
When I go under the Control menu, down to Enable Simple Buttons, the hit zone looks great right in my Flash file, but when I preview it or publish it and look it on different browsers (PC and Mac), I don't get my pointer right over the actual graphic, but get it everywhere around the graphic to the boundaries of my hit box. Why can't I get the actual graphic to be a hot spot in this situation? I have tried leaving the graphic in the hit timeline, and tried putting both the larger box and the graphic in the hit timeline, and still can't get them to respond correctly with the pointer in the browser window.
View 2 Replies
Jan 31, 2010
i can not seem to get a button working with simple gotoAndStop frame . its setup like _root > EMC_photos > photos_thumbs_ani now in photos_thumbs_ani i have several photo pages all setup every 100 frames with labels page 1, page 2 etc my button is within photos_thumb_ani as a movieclip with code inside this.onRelease = function(){ _root.EMC_photos.photos_thumb_ani.gotoAndStop("pag e2");} I have tried different variations to no sucess
View 2 Replies
Apr 14, 2010
I've got a really simple script that on a button click, changes the alpha of a set of mc's from 0 to 100, then on second click changes back to 0. The first click works fine but for some reason the second click isn't working. The button needs to stay "on" as well so I've got the buttons in a mc with named frames "on" and "off". Here's the code:
Code:
ltBlueButton_mc.ltBlueOff_btn.onRelease = function(){
contentMain.page1_mc.Pg1LtBlue_mc._alpha = 100;
contentMain.page2_mc.Pg2LtBlue_mc._alpha = 100;
[Code].....
View 4 Replies
Dec 23, 2010
I have programmatically created a simple button with a text field on top in a separate class extending a movie clip. The problem I am having is that the overState does not seem to be working and I don't know why. I have even tried removing the text field in hopes that would work, but it does not. The GameIntroduction class is called by another class which is the main class.
Here is my code for the class that calls the buttons:
ActionScript Code:
package {
import flash.display.*;
import flash.events.*;
public class GameIntroduction extends MovieClip {
private var introText:String = "";
[Code] .....
View 2 Replies
Mar 2, 2010
I have a simple getURL button within a movieclip within another movieclip. Does anyone have any clue why this isn't working? The button is in the top layer of the child movieclip, and the child movieclip is in the top layer of the parent movieclip, so what am I missing here? I attached a simplified fla to show the issue. In the end, the main red box will be a country on a map and the popup box will contain info about the country and links to pictures and sites.
View 4 Replies
Jul 1, 2011
So I'm trying to learn to create a public class, and this is what is in my class file:
class com.RCN.Menu.Menu{
public var title:String;
public var menuItems:Array;
[code]....
and in a seperate SWF I use the code:
import com.RCN.Menu.Menu;
var Accountability:Menu = createMenu("hello",[a,b,c,d]);
trace(Accountability);
yet Accountability traces as undefined?
View 1 Replies
Feb 21, 2012
I am attempting to create one function to respond to multiple button clicks. I have a simple if statement in my onBtnClick function that does not work. Just need the button that is in that variable to go to frame 1. Trace statements are working inside the statement so I the if statement runs correctly?
[Code]...
View 3 Replies
Aug 27, 2003
This is plain and simple, why is it not working? BUTTON
[Code]...
View 7 Replies
Oct 7, 2009
I just can't figure out why a simple movieclip is not performing as expected.
Here's what happened:
In my MAIN SCREEN, I placed a a movieclip and named it "mainnav_mc" and on my ACTIONS layer, I placed a script on the frame that will eventually play the movie "mainnav_mc". This is the script: mainnav_mc.gotoAndPlay("show");The clip is suppose to fade-in but it seems that MOTION TWEEN is not working. I tried to create a test MC and still it's not working.
View 14 Replies
Sep 21, 2010
I am fairly new to Flash and I am creating a simple Flash login programme in Flash. If I type in the correct password or even if I type in the wrong password it always goes to frame 3 which is "Login Failed! Username or password was wrong". I have attached .fla file. Note I created in Macromedia Flash 8.
View 8 Replies
Aug 11, 2009
I'm having a bit of trouble getting a button in a hoover over drop down menu to link to another scene in the .swf movie. I just doing a basic drop down menu (example here: [URL] with a couple of buttons with in a movie clip, the movie clip being the "button" someone hoovers over. The buttons however are not going to the corrisponding scene I have them set up to. What's strange is that if I set in the buttons action panel to go to an url instead of a scene, in the .swf movie the button works when I click it...it wants to go the specificed url. Nothing happens when it's set to go to a scene.
View 5 Replies
Jul 27, 2010
I am creating a very simple mask using motion tweening. I created some text on a layer and made it a masked layer. Then I created a mask layer which consists of a circle that will span across the text. When I play the movie the circle does not show up at all in the frames the mask layer spans (it's purple on a black background) and the circle does not move across the text like I told it to with the motion tweening. I don't know why it's not working. For some reason the circle isn't showing on the stage at all and it's not moving across the text. I don't know if I have it set up wrong on the timeline or what. Here's the steps I followed to create the mask:
1.insert a new layer in which I named it mask and click frame 1 on this layer
2. select the oval tools on the tools panel and set the stroke to none
3. set the fill color to purple
4. draw a circle and click the selection tool and drag a marquee around the circle to select it.
5. click insert on the menu bar, click motion tween then click ok in dialog box about converting it to a symbol to be tweened
6. click the last frame in the mask layer and drag the circle to the end of the line of text
7.click mask on the timeline to select the mask layer, click modify on the menu bar, point to timeline then click layer properties
8. verify the show check box is selected in the name section, click the lock check box to select it, click the mask option button in he type section, then click ok.
9. play the movie in which the circle object covers the text on the masked layer as it moves across the stage.
View 1 Replies
Jul 14, 2011
I've tried over 4 tutorials to make my movieclip link to a URL. It's just not working for some reason...
Here is my code.
ondemand.addEventListener(MouseEvent.CLICK,goThere);
function goThere(e:MouseEvent){
var request:URLRequest = new URLRequest("www.money.net");
[Code]....
This should work!! There are no compilation errors...
No mouse cursor change on hover... just like nothing is there.
View 7 Replies
Sep 8, 2009
I'm modifying an mp3 player by flabell, and try to get some buttons to work. However, I can't seem to get the getURL to work, even though it works in other parts of the script. This is my code:
mc.rate1.onRelease = function() {
trace(this.ID);
getURL("[URL]","_blank");
};
The trace goes through fine. Here is the code that works:
Code:
private function downloadRelease(mc : MovieClip) : Void {
var title : String = mc._name;
var index : Number = Number(title.substring(title.lastIndexOf("n")+1,title.length));
getURL(songsSource[index], Main.getInstance().mcAlbums.linksTarget);
}
I'm on a mac with firefox.
View 3 Replies
Jan 6, 2006
I'm using Flash Pro 8 and I'm attempting to incorporate events into some of my classes and I'm having nothing but problems. After looking at lots of examples, this all seems okay, but doesn't work. First is the class code and secondly is the code on the timeline.
ActionScript Code:
import mx.events.EventDispatcher;
class iaicu.mycampus.ClassSchedule {[code].....
Keep in mind that these classes are more elaborate, so events are intended to be more useful.
View 7 Replies
Mar 21, 2006
i've tried searching the forums and fighting with this way of fading the movie clip in and out. The movie clip has an instance name of "box", my brother also can't figure it out.
Code:
var fadeChecker:Boolean = true;
function flicker():Void{
if(box._alpha >= 100){[code].....
View 5 Replies
Apr 19, 2006
I have a movie clip called mainClip. Within it is another movie clip called subClip. I am moving the mainClip along the y axis; when it reaches a certain point, then the subClip moves along the x axis.
Here's the basic code:
Code:
myButton.onRelease = function() {
onEnterFrame = function () {
mainClip._y += 10;
[Code].....
The problem is, the mainClip moves just fine, but the subClip won't move at all. why the second script won't work?
View 3 Replies
Mar 8, 2007
I have a simple invisible button over to animations, based on thisThe button is telling onRollover to play frame name, thus playing the animation. and on onRollout it plays another thread.However, once all that is finished it doesn't work properly. Its like the first time you use it, as you roll over works fine and as you roll out fine. However, when you roll over again nothing happens until you come out and it gets all muddled.
Code:
on(rollOver){
gotoAndPlay("blurOver");
[code]....
View 11 Replies
Jan 15, 2012
i have attached an .fla file to show you what i am trying to achieve, i have a line (acting as a playhead) scrolling accross the screen, i am then wanting it to output to the window when it collides with each of the coloured squares, i have used similar things before but it is not working in this instance
View 5 Replies
Nov 2, 2009
I'm working on a simple presentation website in flash that imports swf-banners onto the main page. This works, but I need a backgroundcolor and a border so the banners aren't seethrough. So I create another graphic element that puts itself underneath. All this works, but when I try to write a button to remove the "child" it only removes the imported swf (loader) but it can't remove the box underneath - even if I remove the loader-child completely. I get a "1120: Access of undefined property Kant." error
CODE for buttons & loading the swf:
Code:
stop();
var Xpos:Number=10;
var Ypos:Number=230;
[code]....
Code for "resetting" page:
Code:
removeChild(Kant);
removeChild(loader);
I can't get it to work.
View 2 Replies
Mar 28, 2011
I'm following a tutorial to make a simple game. The aim of the game is for a player to evade a flying enemy ; the higher the score, the faster the enemy. The main elements in the game are the enemy the player and a score card.
However, from following the tutorial, and adding the dynamic text field etc....the score doesn't actually work.
This is the code that I was instructed to place on the first frame of the Scripts layer:
//Game Variables
enemySpeed = 5; //Set Enemy initial speed
numberEnemy = 4; //Change this to add more Enemies
score = 0; //Set initial score to 0
[Code].....
View 2 Replies
Oct 16, 2011
This seems pretty basic but for some reason I absolutely can't get it to work. I have a set of buttons which I want to be able to send their parent movie to the next or previous frame. I want to use a NEXT and PREVIOUS button, both combined within a single movieclip, to tell a parent file to go to next and previous frame.
This doesn't work:
previous_btn.onRelease = function(){
this._parent.prevFrame;
} next_btn.onRelease = function(){
this._parent.nextFrame;
[Code] .....
View 5 Replies
Jun 23, 2009
I've looked everywhere and keep getting the same answer. I have a standard flv player component with the instance name of 'movies'. i have a button, that when clicked i want it to load a certain flv into said player... so... ive got behind the button (for example..)
on (release){
_root.movies.contentPath = "http://www.mywebsite.com/mymovie.flv";
}
it compiles, i run my flash and my flv player doesnt play my content.. why?? the url is 100% correct as if i put it in manually, it works fine.
View 5 Replies
Feb 19, 2005
i cant seem to get a simple if/then statement working with an input text. Here is my AS
[AS]
on (release) {
password = inputName
if (password == "test") {
[Code].....
For some reason when i type in test in the movieclip inputName it still sends me to ign.com. Everything is in the same frame and i just cant get it working.
View 1 Replies
Oct 26, 2009
I have found this fine example for multilanguage choice:URL...I have changed initLanguageSelector() to this:[code]It works OK with button component but I need it to work with simple movieclip or button.
View 2 Replies
Mar 7, 2011
I am doing a simple login page application in FlashBuilder 4.0 & I have kept 2 input boxes like Login,Password and a submit button. On clicking the button I am calling a method, so far everything is working fine. But some how tabenabling is not working. suppose if you are in login inputbox and i press "tab key" it has to go to password input box.. but its not working. I have tried all the attempts using tabEnabled = "true". But still I am failing to do this.
View 2 Replies
Mar 28, 2011
I'm following a tutorial to make a simple game. The aim of the game is for a player to evade a flying enemy ; the higher the score, the faster the enemy. The main elements in the game are the enemy the player and a score card.However, from following the tutorial, and adding the dynamic text field etc....the score doesn't actually work.This is the code that I was instructed to place on the first frame of the Scripts layer:
//Game Variables
enemySpeed = 5; //Set Enemy initial speed
numberEnemy = 4; //Change this to add more Enemies
score = 0; //Set initial score to 0
[code].....
View 1 Replies
Oct 27, 2006
I wish to detect and store the IPs of the users of my site which is All-Flash-Built. My goal is to later have the ability of banning some users...Where can I find a simple IP detect method in Flash working with a MySQL DB via PHP?
View 1 Replies