ActionScript 3.0 :: Scripts Not Working After Frame 1
May 8, 2011
I'm making a prototype game for a Uni project and so far I have setup classes and movie clips for navigation of the menu screens. I have my movie clips all declared in the Document main file and positioned on the Stage. Everything seems to work fine at first but then when I try to go back to the title screen from say the help screen the buttons on the title screen(frame1 BTW) stop working.
View 2 Replies
Similar Posts:
Nov 25, 2011
This is an if stament on a frame on the root. I want to loop Carrera(a lenghthy movieclip) from frame 2 back to frame 1. (For testing purposes) This is the code:
[Code]...
View 3 Replies
Apr 7, 2009
I have navigation buttons that are linked to frame labels on other scenes and when you double click them they go to the next scene.
For example if i was to click the home button twice it would go to the info scene and if i click it a third time it will go to another scene.
This is the actionscript im using:
What do i need to add or do to fix this
View 3 Replies
Sep 28, 2009
I've got a simple button that when clicked needs to go to a particular frame and stop when it hits the stop(); however when I test it I get a type error #1009 Cannot access a property or method of a null object reference. at PostCard_fla::MainTimeline/frame25()
I need to be able to tell it what frames to go to manually so the user can jump around the time line using short animated transitions between pages (set up like a web page) in AC2.0 this was easy, but its different in AC3 and I'm not quite sure what I'm doing wrong.
This is my code:
stop();
btn_flip.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
gotoAndPlay(28);
};
View 1 Replies
Oct 23, 2011
i have a main page that works perfectly wen i just open my site, in it are buttons that takes me to three other minor pages, there are buttons in the minor pages that takes you back to the main page. when i click on these buttons and get i succesfully get to the mainpage, the codes don't work anymore and i cant click on the buttons to go to the minor pages.this is the code i use:
stop();
buttons.buttonmotion.addEventListener(MouseEvent.CLICK, klk);
function klk(event:MouseEvent):void {
gotoAndPlay("motionreal");
[code]....
View 3 Replies
Mar 23, 2011
Today I found that flash had no option to jump to unassigned frames.
Say, I am working on frames numbered from 1 to 250. Now I need to jump to frame number 15000 and I found that I cannot jump to the frame number 15000 directly. I have to click in the Timelline and move the scroller right to its full extent, again click in the last frame visible in the time line and so on continue this until I reached the frame 15000.
Is there any easy way to jump to frame 15000 ??
View 2 Replies
Aug 5, 2009
I have a flash .fla called image.fla. I have a document class file called controls.as that is linked to the
image.fla. The .fla has the following frames; frame_1, frame_2, frame_3,etc
I have buttons such as button_1,button_2,button_3,UploadBtn (common for all frames) in stage etc when i click the button1 it will goto frame_1,if i click button_2 it will goto frame_2,etc.,All frames contains
my_mc..
Within the controls.as file,i ve the functionalites like uploading the jpeg,creating the text for my_mc etc.,
for 1st frame all functionalites working(i can upload,Creating text)..but if it's goes to frame_2
no action for that btn..The .as file only working for 1st frame alone..
View 2 Replies
Sep 7, 2011
I have my code in 1st frame. It contains many functions. 2nd frame has only stop(); code. when My movie goes to 2nd frame, i get many errors from functions of 1st frame. Well, that error is caused by one function which is ENTER_FRAME based, but that makes no difference. Why doesnt it stop working in next frame?
View 3 Replies
Nov 22, 2009
I just migrated to CS5.5, and I'm seeing some weird behavior with imported movie clips within Flash Builder. I've got an .fla with a MovieClip with an AS Linkage of 'Card'. I've exported the .fla as a .swc, and included it within an Actionscript Project in Flash Builder.
Previously, I would call the code:
for(var i:Number = 0; i < currentCards.length; i++) {
var currentClip:MovieClip = MovieClip(currentCards[i]);
MovieClip(currentCards[i]).gotoAndStop('unselected');
}
and everything worked completely fine. When I run this code within Flash Builder 4.5, after reexporting the .swc from Flash 5.5, I get the error:
ArgumentError: Error #2109: Frame label unselected not found in scene unselected
I thought there might be something funky going on with the scene assignments, so I changed the code to be:
MovieClip(currentCards[i]).gotoAndStop('unselected', 'Scene 1');
but then it couldn't find Scene 1. I finally changed the code to:
MovieClip(currentCards[i]).gotoAndStop(2);
and it worked fine. But why isn't it picking up my frame labels?
View 1 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
Feb 17, 2011
I have a loaded swf which contains sound on its frame. Even though I have unload it, the sound still playing. I cannot get rid of it. I've tried:
- _loader.unloadAndStop();
- SoundMixer.stopAll();
- System.gc();
View 1 Replies
Aug 23, 2011
I have a SWF with two buttons that both direct users to new URLs. The first frame contains an FLV. During the playing of the FLV, the buttons work fine. When the FLV is complete, the SWF plays, resizing and moving the buttons. During the movement of the buttons I can click them and they work--while moving. But they don't work once the SWF reaches the last frame and stops. I need the buttons to work the whole time, especially at the end. [URL]
View 3 Replies
Nov 27, 2009
I have a series of as2 button instances which are intended to navigate an HTML site with simple getURL commands, but no matter what I do they only load the index.php file and I can't get them to open the page in the _self window. Here's the code:
addMenuActions();{
btn1.onRelease=function(){
getURL("index.php","_self");
[Code]...
View 2 Replies
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
Dec 1, 2010
I'm working on a dating sim (don't ask) and I already figured out most of the variables, but I have one problem. When the experience with one of the characters is a certain ammount, I want to play a different frame of dialouge.
Is there a way to play a new frame, only if the variable equals 10?
View 3 Replies
Mar 10, 2011
I'm working on putting together a portfolio website in Actionscript 3.0, and here's my situation: I have four main sections (Home, Works, Reel and Contact). When you first enter the website, it directs you to the Home content, which is on Frame 1. When you click on Works, it is intended to take you to Frame 2 - which it does just fine. On the works page, however, there is a frame to display large versions of the row of thumbnails along the bottom. Frame 2 automatically displays the large image of the first thumbnail, but the second thumbnail redirects you to Frame 3, which is identical, except it replaces the large image of the first thumbnail with the large image of the second thumbnail - and so on and so forth.
The thing is, when I get to Frame 2, my thumbnail buttons aren't working and I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Portfolio_Site_03_fla::MainTimeline/frame1()
What I'm getting from this error is that it essentially doesn't recognize my thumbnail buttons because they do not exist on frame 1. I even attempted to move the keyframes with the thumbnail buttons on them to frame 1 and everything was working just fine, except for the fact that I had big thumbnail buttons all over my home page which I do not want to be there. For reference, here is my AS code:
ActionScript Code:
stop();
import flash.events.MouseEvent;
import flash.net.URLRequest;
//---Home Button---\
Home_Button.addEventListener(MouseEvent.CLICK,hClick);
function hClick(event:MouseEvent):void{
[Code] .....
How can I resolve my situation and get my buttons to do what I want them to do? My only guess would be that I'd need to make a new scene, but wasn't that one of the major points of AS 3.0?
View 1 Replies
Jan 12, 2009
Now I'm working on a Website which contains a XML Carousel Gallery, with the coding below.Now this all happens on the homepage. I would like to stop the xml on other frames though. Is there any coding I can use on my Buttons, to stop the XML working while going to another frame?
stop();
var folder:String = "thumbnails/";// a folder for thumbnail files + an XML file
var total:Number;
var radiusX:Number =180;
var radiusY:Number = 10;
[code]...
View 2 Replies
Mar 23, 2011
Today I found that flash had no option to jump to unassigned frames. Say, I am working on frames numbered from 1 to 250. Now I need to jump to frame number 15000 and I found that I cannot jump to the frame number 15000 directly. I have to click in the Timelline and move the scroller right to its full extent, again click in the last frame visible in the time line and so on continue this until I reached the frame 15000.
View 4 Replies
Jul 11, 2009
I've got a nearly completed Flash site, but one of the buttons isn't working--sometimes.
It's hard to explain, so here's how you can see the problem. Run the .fla below, wait for the animation to stop, and click the "services" star. Two more stars appear: "design and production" and "editorial." If you click on "design and production" first, everything works fine. You can get to editorial and everywhere else. BUT if you click on "editorial" first (after clicking "services" but before clicking "design and production"), the "design and production" button doesn't work from there (the "editorial" label frames in the "inline_frame" movie clip).
I've got several Actions keyframes in the "inline_frame" movie clip--I don't know if that's kosher or not.
View 1 Replies
Nov 23, 2009
Run the .fla below, wait for the animation to stop, and click the "services" star. Two more stars appear: "design and production" and "editorial." If you click on "design and production" first, everything works fine. You can get to editorial and everywhere else. BUT if you click on "editorial" first (after clicking "services" but before clicking "design and production"), the "design and production" button doesn't work from there (the "editorial" label frames in the "inline_frame" movie clip).I've got several Actions keyframes in the "inline_frame" movie clip--I don't know if that's kosher or not.
View 2 Replies
Jan 21, 2010
After finally making a button with an animation in it, I get stuck with the button actually working. I followed this tutorial; [URL] for the most part. And when I link the button to an URL like it uses as an example in the tut it works. But when I want to link it to a frame label in my website it doesn't work. Atm the code in the movie clip on the hit area looks like;
on (rollOver, dragOver) {
gotoAndPlay("on");
}on (rollOut, dragOut) {
gotoAndPlay("off");
}on (release) {
gotoAndStop("Scene 1", "who")
}
The rollover/out works fine. But the link isn't working within the Flash file.
Here is the .fla: [URL]
And a CS3 version: [URL]
View 2 Replies
Oct 10, 2009
In the first frame of an fla I have the code below, only the functions in red works. When rolling over the second only the first function in blue works but the mouse freezes when attempting to rollout (green). But if I remove the code from the first frame and code each seperate button the functions work.
Any reason for this
stop();
btn_shopping.onRollOver = function () {
gotoAndStop(2)_root.main_mc.gotoAndStop(1065);
} btn_shopping.onRollOut = function () {
gotoAndStop(1)_root.main_mc.gotoAndPlay(162);
} btn_pen.onRollOver = function () {
gotoAndStop(3)_root.main_mc.gotoAndStop(1066);
} btn_pen.onRollOut = function (){
gotoAndStop(1)_root.main_mc.gotoAndPlay(283);}
View 2 Replies
Nov 6, 2009
Im having a little bit of trouble trying to make a button give me different results based on what frame the main timeline is on. I am trying to get a button to go to a different link based on what frame the main timeline is on. If I am on frame 5 It will trace back "4" .. that is fine but other frames trace back the frame number and also 4.
frame 2 click of button traces back 1 and 4
frame 3 click of button traces back 2 and 4
frame 4 click of button traces back 3 and 4
frame 5 click of button traces back 4
[code]....
View 8 Replies
Apr 19, 2010
Ok... I have 2 scenes.... 1st scene is an intro menu with several movie clip symbols (let's call them buttons for all intents and purposes) that gotoAndPlay various sections of the 2nd scene when clicked ... The various buttons on this intro screen point to different frame numbers in the 2nd scene... button1 goes to frame 1 of scene 2... button 2 goes to frame 10 of scene 2.... button 3 goes to frame 20 of scene 2 and so on....
when I click the 1st button, it takes me to the 2nd scene at frame 1 and correctly shows me that page ... (all 2nd scene pages have a navigation bar at the top to access the other 2nd scene pages) ... when I click on a navigation button it takes me to the next page within the 2nd scene that I am looking for and each progresive page works correctly.
[Code]....
View 6 Replies
Jul 30, 2010
I'm working on a multiple-choice quiz. Each question is in its own frame, Q1, Q2, Q3, etc. In Q1 frame, when I click a radio button (A, B, C, or D) it displays a Continue button which when clicked takes me to frame Q2. In frame Q2 I have a Return button that brings me back to frame Q1. The problem I'm having is that when I click the Return button in frame Q2, it takes me back to frame Q1 and I can click on radio buttons A, B, C, or D, but they do not display the Continue button. In other words the radio buttons change state but they do not fire any of the actions. Here's my code.
//Q1 frame code (AS2)
rbtnAListener = new Object();rbtnAListener.click = function(evt){ mc_EmptyContinue.attachMovie("btnContinue", "btn_Continue", 1); mc_EmptyContinue.btn_Continue.onRelease = function():Void {
[Code].....
View 10 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
Aug 31, 2009
I have a function with some if and else...if statements in a particular frame. In this assessment program, the user goes to other frames, then evaluates several variables at the end. If the user gets more than 3 wrong, the user goes back to the scenarios that were missed (i.e., a particular frame label). When I have tested this program, I can get back to the right frame/scenario, but a particular button's function won't work. Is there something where I need to "reset" this function the second time the user goes through it because it remembers what was done the first time?
View 1 Replies
Mar 13, 2009
I've found the solutions for most of my many problems with as 3 but this one is really baffling The frame actions of child-movieclips of dynamically added movieclips are not firing! If I have movieclip, say "mc", which contains a child-movieclip "submc" which has a timeline animation in it with "stop();" on the last frame and I add "mc" on the stage via addChild() the stop action inside the sub movieclip will not work.
All the frame actions inside "mc" itself work. Everything works if I drag the movieclip onto the stage manually. Right now the only way I can see to stop a movieclip on its last frame is by using the ENTER_FRAME event, but that's awfully cumbersome.
View 9 Replies
Jul 11, 2009
I've got a nearly completed Flash site, but one of the buttons isn't working--sometimes. Run the .fla below, wait for the animation to stop, and click the "services" star. Two more stars appear: "design and production" and "editorial." If you click on "design and production" first, everything works fine. You can get to editorial and everywhere else. BUT if you click on "editorial" first (after clicking "services" but before clicking "design and production"), the "design and production" button doesn't work from there (the "editorial" label frames in the "inline_frame" movie clip). I've got several Actions keyframes in the "inline_frame" movie clip--I don't know if that's kosher or not.
View 3 Replies
Sep 13, 2009
I'm working on AS3 on main timeline. I have 20 frame labels parte1 to parte20. On parte1 I have a preloader and SharedOject code. The preloader works fine. On parte8 I have a movie clip (whole_master), which contains three frame levels (g_level_1, g_level_22, and g_level_33). Each frame contains a level of a game. My sharedObject doesn't work.
Code:
//Saving data
var so=SharedObject.getLocal("learningGames", "/");
so.data.whole_master=whole_master;so.data.g_level_1=whole_master.g_level_1; so.data.g_level_22 =whole_master.g_level_22;so.data.g_level_33 =whole_master.g_level_33;
//testing if shared object exists
[Code] .....
View 2 Replies