ActionScript 3.0 :: Code A Button With Actions Depending On Timeline?

Jul 28, 2009

I am like a new-born-newbie when it comes to Action Script 3.0 (or any other version for that matter). I've been trying to learn it by myself for the past week and a half using manuals and other sources but it's not so easy as there are many concepts that take some getting used to (I've never done programming before). So I ask of anyone who is kind enough to give me a hint or point me in the right direction. I am sure this will seem like a very easy and probably stupid question for the well-informed but it has been eluding me for the past 4 days.

I am making a website (I should say it's pretty much finished except for this one detail) it's simple and short. Nothing very fancy. There are 8 buttons in total for the main navigation (4 buttons in English and 4 in Chinese, each language group in their own set of frames)

the button that serves as a link to the Chinese translated version of the site is supposed to go to a particular page, depending on which page the user is in at the moment (example: if it is in the portfolio page in English, when clicking on the Chinese button it should go to the portfolio page in Chinese and so on). Likewise with the English button in the Chinese version pages.[code]...

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Add Code To Get The Actions To Loop Like The Timeline Is Looping?

Jul 16, 2010

I am new to FLASH and have created a rotating banner for our website with 5 roatating images with 5 invisble buttons linking to 5 landing pages. And it works the first loop through.  However when it gets to action 5 for my last image, that link continues for all the buttons is subsequent loops.What do I need to add to my code to get the actions to loop like the timeline is looping? Code used for the links. This is the link that continues after the first run of the banner:

var url5:URLRequest = new URLRequest("http://www.facebook.com/MoDOT.KansasCity");, onStageClick5);
stage.addEventListener(MouseEvent.CLICK[code]....

View 1 Replies

ActionScript 3.0 :: Play A Certain Part Of MovieClips Timeline Depending On The Button Pressed

Nov 22, 2010

Right I only want to play a certain part of my MovieClips Timeline depending on the button pressed.

ActionScript Code:
stop();
CircleLineMC.KingsCross.addEventListener(MouseEvent.MOUSE_DOWN, KingsCrossBtn);
function KingsCrossBtn(event:MouseEvent):void {
BigSquare_MC.gotoAndPlay(1);
}

But I want it to play only up to frame 50 and then stop there and then loop instead of playing the whole timeline, does anyone know How to do that.

View 6 Replies

ActionScript 3.0 :: Timeline Actions Ovverriding Actions In New Frame?

Jun 19, 2011

I have a series of frames one the timeline. Each frame has a graphic and a mouse click leads to the next frame. Think Myst.

[Code]...

When the middle frame is returned to, clicks no longer change anything. I believe that the actions of the 'left' frame are replacing the one's in the middle frame so then it is told to gotoAndStop to itself.

I'd like to know if that is indeed what is happening and how I can make it stop.

View 1 Replies

ActionScript 1/2 :: Actions Depending On Input Text Values?

May 8, 2011

I have started to use input texts and passing them to outputs etc.I was wondering, is there a way in AS2, to, for example if someone enters a value that's between 150 and 200. Accepts it, and the code somehow recognizes the range if value from 150 to 200, perform a function (for example setProperty on something to visible true) a different function would apply if someone enters a value between 100 to 150.

View 10 Replies

ActionScript 3.0 :: Filter Xml To Only Do My Actions Depending On When Child Matches Request?

Mar 24, 2009

How can I filter a loaded xml to only do my actions depending on if a xml child matches my request?

View 5 Replies

ActionScript 2.0 :: Code A Button In The Main Timeline?

Oct 6, 2009

i need to code a button in the main timeline and this is the code im using:

ActionScript Code:
stop();
stuff = 0;
day = 1;
money = 50000;

[code]....

There is an error with line 9- the one in bold. its a syntax error- but whats wrong with it!

View 9 Replies

ActionScript 1/2 :: Pull Button Code And Use It In Main Timeline?

Aug 15, 2009

I have a Flash project which has about 90% of its code in the first frame, on a layer called 'actions'. the remeainder of the code is attached to several buttons throughout the project. I want to take the code attached to the buttons, and paste it into the first frame, 'actions' layer. what I want to know is how to do it, and still have the buttons function properly. This is in AS2, and will eventually be converted to AS3, when I get all the working code on the first frame. I don't know how to reference it, from the first frame of 'actions' layer.

[Code]...

View 1 Replies

Actionscript 2.0 :: Code For Button On Separate Layer In Timeline?

May 18, 2011

I made a button a stage, and I want the button to take the user to a separate scene that I have named "Biography page" when it is clicked. The thing is, I want all my actions on one specific layer. So I made an instance name for my button, "aboutme". The thing is... I have no idea how to write the code.

[Code]....

View 3 Replies

ActionScript 3.0 :: Stopping Root Timeline & GotoAndStop Button Code?

Oct 18, 2009

I want to tear my hair out and cry! I've just upgraded to CS4 and am trying to create a simple swf that consists of a root timeline with various frames, each labelled 'home', 'bio' & 'contact'. There are buttons on the stage with instance names and then on the first frame of my root timeline I have the following code (as well as the _root.stop() as actionscript on the labelled frames):

Code:
_root.stop()
homebtn.onRelease = function():Void {

[code].....

View 2 Replies

ActionScript 3.0 :: Code The Button Inside The Movieclip To GotoAndPlay To Frame 1 On The Main Timeline?

May 11, 2011

ive made a simple game for a uni project, when you get game over a movieclip comes up and inside the movie clip there is a button to restart the game. how to i code the button inside the movieclip to gotoAndPlay to frame 1 on the main timeline?

[Code]...

View 4 Replies

ActionScript 2.0 :: Original Code Which Works Fine When Button Is Present On The Root Timeline?

Jan 21, 2008

//This is my original code which works fine when my button is present on the root timeline
btn_up.onRelease = function() {
getURL("javascript:Launch('website.html', 2000, 1200)");

[code]....

View 2 Replies

Flash :: Timeline Code To Object Oriented Code - Access Instances Already On Stage

Jan 12, 2011

As stupid as my question might sound, i have spent the last 2 weeks reading oop books; but could use some guidance. I have a flash project that is basically a supped up slide show. On the stage i have the following: main_mc (instance name = images_mc) = movieclip which holds "pictures" ui1 (instance name = ui1_mc) = user interface that allows user to draw on picture (when drawing is enabled) ui2 (instance name = ui2_mc) = activates invisible hit areas (buttons) on select pics, when hit area is clicked, we jump to another pic in the main_mc.

I accomplished all of this on the timeline, but am updating the code to OOP. I am having A HELL OF A TIME trying to figure out how to store references to the instances (images_mc etc..), so i can control them from varying class files. I have found it is easy to control the instances from the documentclass, but not from unrelated class files. Example: images_mc.stop(); works in document class; but ovieclip(Parent).images_mc.stop() doesn't seem to work from any class file.(ui2 class file for example);

[Code]...

View 2 Replies

ActionScript 3.0 :: Way To Have Main Timeline Code Interact With Code Inside Of Symbol.

Jan 29, 2012

I'm looking for a way to have my main timeline code interact with code inside of a symbol.I'm tying to get my timeline inside the symbol to gotoAndPlay(10) when something happens in my main timeline code.

View 3 Replies

ActionScript 3.0 :: Timeline Code And Separate AS File Code Working Together

Dec 27, 2010

Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?

View 7 Replies

ActionScript 3.0 :: Overriding Actions In Child Timeline?

Feb 25, 2010

I'm an animator trying to use actionscript along with timeline animation.The setup is flock>fly>wings flock movieclip 30f long, the script looping, starting multiple fly movieclips at different points.
 
fly movieclip 30f long, controls wings0 movieclip timeline (3 frames, each with a movieclip).       Frame1: wings0.gotoAndStop(2)      Frame24: wings0.gotoAndStop(1)      Frame48: wings0.gotoAndStop(3)

From flock timeline I'm trying to override actions in fly3. to call a different wings0 animation.
 
flock Frame1: var loop:Number = 0; fly1.gotoAndPlay(15); fly2.gotoAndPlay(8); fly3.gotoAndPlay(20); if(fly3.currentFrame==24){ fly3.wings0.gotoAndStop(3); }
flock Frame 30:
loop = loop + 1;if (loop > 0) {this.gotoAndPlay(2);} else {this.stop();}
  
But the animation of fly3 doesn't change.

View 7 Replies

ActionScript 3.0 :: Click On 'actions' Timeline Collapses?

Mar 18, 2010

my first post one here so i hope someone can be of assistance.I have been using actionscript 3.0 with no problems for a couple of months, but i suddenly encountered a problem that i can't get beyond now.when i click on 'actions' my timeline collapses. This happens whether from right clicking on my timeline or selecting it from the top menu.Since this has happened i can't find a way of bringing up the actionscript screen.

View 3 Replies

ActionScript 2.0 :: Actions Still Executing After Being Removed From Timeline?

Jun 17, 2009

This is maddening - I'm clearly missing something about how actions relate to the timeline.I some actionscript on Frame 1 of my movie that changes the color of a movieclip on the stage on MouseOver/Out. I then have actionscript that takes you to Frame 10 when this movieclip is clicked.Here's the problem: On Frame 10, I DON'T want the MouseOver/Out actions to execute, and I have cleared the keyframe containing those actions on Frame 10 - there is no actionscript detailing MouseOver events what-so-ever on Frame 10. Yet, these events are still occurring, which leads me to believe the movie still thinks it's on Frame 1, even though it's showing Frame 10.Is there some method of clearing any existing Actionscript from previous frames when it reaches a new frame (I thought clearing the keyframe was supposed to do it, but apparently not)

View 1 Replies

ActionScript 3.0 :: Frame Actions Not Working On Timeline

Feb 4, 2010

For some reason, I can't get any actionscript on the timeline to work. Even something as simple as stop(); on frame 1 of the movie has no effect. I don't get compiler errors either. Now I have noticed that in Edit-Preferences-Actionscript-Actionscript 3 Settings, the Source Path, Library Path and External Library Path are all empty.

View 4 Replies

ActionScript 3.0 :: Timeline Actions Ignored When Loaded Into Parent Swf

Jan 25, 2009

If I have a movieclip in my library with some animation on the timeline and actions as well (stops, calls to other methods, etc.) and at runtime I add this clip to the display list, everything works as expected. The actions in the timeline of said clip are fired.If however, I load this file into another swf all the actions in the movieclip are ignored.Attached is a demonstration of this behavior. simply runnning Child.swf on it's own will show nothing as there is a stop on the first frame of the attached clip. However run the Shell.swf (which loads Child.swf) and you'll see the animation of the movie clip. There are no calls anywhere telling anything to start playing. What's worse, the method call further down the timeline and the stop and the end of the timeline are also ignored. Compiling these files and looking at the Output window, you'll see the trace from the method "__testCall" is never fired.Is this a bug with the Flash Player?I've had to use addFrameScript as an alternative to actually having the actions on the timeline. lame.

View 3 Replies

Professional :: Combine Two Actions In Code Correctly?

Apr 2, 2010

playback controls, however I still have a problem.  I want to have an  additional button that links to a website (I have coded this correctly  with actionscript and works great. Now I have two seperate  projects...one project has my playback controls and the other has a  button that links to a website.I am having problems combining both action script codes and having everything working properly  My code for each  is below. How do I arrange them into one?

Code for link to website:
website_btn.addEventListener(MouseEvent.CLICK,gotoWebsite);
function  gotoWebsite(evtObj:Event):void{  var theSite:URLRequest =  new

[code].....

View 9 Replies

ActionScript 2.0 :: Changing The Function Of A Button Depending On Previous Button Press?

Mar 14, 2007

I'm loading in 5 jpegs from an external file using "loadMovie" and i have 5 corresponding buttons (1-5) to load them with.

I want to change the jpeg the button loads in depending whether a separate navigation button has been pressed -

i.e.

navigation buttons:

-motorbike pics
-car pics
-lorry pics

If a user clicked on "car pics" then the loading buttons 1 to 5 would load "car1.jpg", "car2.jpg" and so on...

similarly if the user clicked on "lorry pics", the same loading buttons 1 to 5 would load "lorry1.jpg" and "lorry2.jpg"

View 1 Replies

ActionScript 3.0 :: Make Timeline Actions Of A Loaded Swf Execute?

Aug 22, 2009

I've got a little movie player class that loads and plays swfs given a url string.However, in some of my swf's for example there are Actions on certain frames to stop() certain movieclips. But they aren't getting executed when loaded with my class therefore some of those child clips will keep looping until the movie is over. Is there a way to instruct Flash to execute the timeline actions of a loaded swf?

View 6 Replies

ActionScript 2.0 :: Code For Assigning Actions For Buttons Trough Out Xml?

Sep 22, 2011

Code for assigning actions for buttons trough out xml

View 2 Replies

ActionScript 2.0 :: Editting Code From Movieclip To Actions Layer

Dec 7, 2009

i'm currently having a small problem with some Actionscript 2.0 in CS3. I'm following a tutorial to make a simple maze like game Tutorial here: [URL] I'm currently at step 5 where it's coding the movement and wall detection.. The problem is the tutorial wants me to apply the code directly to the maze/wall movieclip. However as this is for a college project my lecturer will not accept actionscript directly applied to buttons or movieclips.. He basically wants all the script on a seperate actionscript layer. So basically what i'm asking is how and what part of the code do i need to change so it'll still work even though it's on a different layer!

[Code]...

View 3 Replies

ActionScript 2.0 :: Restrict Timeline Actions To Inside A Child Movieclip?

Mar 24, 2011

I've done a website with different pages using the Loader component. On one page I have a movieclip that has different images (like a slideshow) that fade between each other. I'm trying to add an action to make the movieclip pause for a few seconds between each fade. So I've added this action between each fade (in a layer, above the graphics layers, that only holds actionscript):

Code:
stop();
function restart(){

[code]....

View 3 Replies

ActionScript 3.0 :: Referencing Timeline Actions Within A Movie Playing In UILoader Component?

Apr 14, 2009

I'm loading an external SWF("slides.swf") into a AS3 UILoader component on the main stage with an instance name of "loadWindow" when the user clicks a button.I'm also monitoring "slides.swf" loading with preloader script. When the movie in the UILoader is completely loaded, I want to advance it (the movie within the UILoader) to the next frame. In AS2 it was easy to reference a swf loaded into a movie clip... the nested movie's root took the place of the MC's timeline.

stop();
load_btn.addEventListener(MouseEvent.CLICK, loadFile);
function loadFile(e:Event):void {

[code]....

View 2 Replies

ActionScript 3.0 :: Access Of Undefined Property But Didn't Get These Errors When Code In An Actions Frame?

Sep 18, 2010

with this code I get the following errors:

"Access of undefined property stage.
Access of undefined property pressHandler
Access of undefined property myTimer
Access of undefined property timerHandler"

I didn't get these errors when I had the code in an actions frame.Just now that I have them in a seperate document class they come up.

View 1 Replies

ActionScript 2.0 :: Give The Actions To A Button On Top Of Another Button?

Apr 3, 2004

is there someone who know's how to give the actions to a button on top of another button. If I try to do this, the button on top doesn't reacts.

View 10 Replies

ActionScript 3.0 :: Load Different Swf Files Depending On Button?

Apr 13, 2009

im starting to get the hang of 3.0 now.. but i have a little problem loading different swf files related to witch button i click..
 
everything works just fine. when clicking on a button the movie plays and its listening for the end of each video playing.. but i cant get it to load different swfs depending on witch button is clicked. is it possible to do this using the same loader as i do now?
 
heres my code:
 
var compact:String = "axesse_mc.swf";var compactreq:URLRequest = new URLRequest("axesse_mc.swf"); 
var loader:Loader = new Loader();loader.load(compactreq);

[Code].....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved