ActionScript 3.0 :: Putting Actions On Frames Outside Of The First Frame?

Dec 12, 2010

I've heard a few things that people recommend not doing unless you absolutely need to. I'm new to actionscripting. I come from a PHP/Javascript background. I was wondering what kind of things are good and bad.I heard using scenes wasn't a good idea. As well I heard that putting actions on frames outside of the first frame isn't such a good idea unless you absolutely need to.I'm curious what good practice is for working with amfphp. Should I make an AMFPHP class in flash? Do I avoid putting functions into the frame actions

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Putting Multiple Instances Of The FlvPlayback Component In Different Frames And Using Buttons To Navigate To Frames

May 2, 2011

there seems to be no accepted method of playing multiple flv using buttons. My latest attempt has me putting multiple instances of the flvPlayback component in different frames and using buttons to navigate to those frames. It works but nothing anyone has posted anywhere will result in removing the flv when you go to a different frame and instance. This was simple in AS2. Load movie to a traget and each time you load a new movie the other one goes away. REALLY goes away.

View 7 Replies

ActionScript 3.0 :: Putting Actions On A Piece Of Text?

Aug 13, 2011

Over the course of four nights in April and May of 1941, Belfast was attacked by the German Luftwaffe bombers. Their aim was to destroy strategic targets in the city which were aiding the British War Effort.What I want is for users to be able to select the word 'German Luftwaffe' and then they will be brought to another frame with information on that topic.

View 1 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 3.0 :: Putting Code In A MovieClip Frames?

Aug 9, 2011

On the stage, I have a movie clip called mc which contains 20 frames.I have put mc.stop(); on frame1 of the main timeline, this puts a stop action in frame1 of mc.Now I want to put a stop(); action on frame10 of mc using the main time line where all my code is.
 
The code fl.getDocumentDOM().getTimeline().layers[0].frames[0].actionScript = 'stop();'; does seem to work and I don't know what to import.There also a code method addFrameScript(0, customFunction); but it only crashes flash player.

View 6 Replies

ActionScript 1/2 :: Put Another Set Of Actions In Frame 2 Of The Actions Layer?

Sep 29, 2010

1. Can i put another set of actions in frame 2 of the actions layer?i tested but it doesn't seem to work..it has 836 rows of code and it's getting annoying when tryin to search for a function..
 
2. I am not that familiar with classes, i usually put all the code into movieclips or in actions layer.. i am not sure if i can call a function from a actionscript class..
 
3.I am curios if there is any way i could specify an alternative for the if statement like in this pseudocode:
 
if ( apple is not clean BUT is tasty)
{
eat(apple)
}

View 5 Replies

ActionScript 2.0 :: Actions Don`t Work Across Frames?

Apr 4, 2005

I`m tying to get this script to work across all frames... but it doesn`t so I copied it to the first few - then it works.

View 2 Replies

ActionScript 2.0 :: Actions Don’t Work Across All Frames

Apr 4, 2005

I`m tying to get this script to work across all frames... but it doesn`t so I copied it to the first few - then it works. But why doesn`t the first version work?

View 2 Replies

ActionScript 3.0 :: Object Created In A Frame's Actions Telling Parent Frame To Delete It?

Jan 21, 2009

I've got an object (an instantiation of my own class that extends Sprite) being created in the actions for a frame, like this:

Code:
import Scripts.CFoobar;
var foobar:CFoobar = new CFoobar();

[code]........

View 2 Replies

ActionScript 2.0 :: Elastic Frames - How To Include Button Actions

May 16, 2005

I have this code for my elastic frame. I have four movieclip buttons which corresponds to different frame sizes. How to include button actions in to this code. For example when if statement (mcElastika._width = 700) is met.

speed=.95;
mcWidthA = [700, 600, 500, 200];
mcHeightA = [450, 350, 300, 200];
btnA = [mcMenu.mcPortfolio, mcMenu.mcReferences, mcMenu.mcInfo, mcReset];
for (var ivar = 0; ivar<btnA.length; ivar++) {
[Code] .....

View 14 Replies

Actionscript 3 :: Adding Actions To Button Symbol Frames In Flash CS5?

Sep 27, 2010

For some reason I can't add ActionScript actions to a timeline frame within a Button Symbol, like I normally would with MovieClip symbols or on the stage. The Actions panel shows this message:"In ActionScript 3.0, code cannot be placed directly on objects. Please select a frame..."even though I definetely have a frame selected.

EDIT: Screenshot as requested. As you can see, a frame is clearly selected...

View 1 Replies

Actionscript 2.0 :: Way Of Putting Multiple Levels In One Frame?

Jun 30, 2009

I've made it generate enemies and give the player a way to destroy them, i want it so when all the enemies are dead it should move onto level 2, a new frame, or maybe you guys know a better way of putting multiple levels in one frame? so far i have got.[code]

View 4 Replies

ActionScript 3.0 :: Putting Code From .as Files Directly Into A Frame Instead?

May 8, 2011

I have a situation where I am modifying a working FLA file to work in just one Scene of a project I am working on.The FLA file is linked to two external .as files.

I would like to take that code and call it from Fram 1 of the Scene as it will only but used for that scene and I do not want it affecting the other scenes.
 
I removed the package wrapper and changed any private function/public function just to function etc.part of the issue is calling on Movieclips in the library.I am trying to use drag and drop to drag Movieclips to Target transparent Movieclips.
 
The .as files uses:
  
import THE;
 
 
In a function I use:
 
the = new THE();            addChild(the);            the._targetPiece = tTHE_mc;            the.addEventListener(MouseEvent.MOUSE_UP, checkTarget);            the.x = 103.50;            the.y = 72.60;
  
I get an error for the "import THE;" as error 1046: Type was not found orwas not a compile-time constant: THE I get the error for the function reference as: error 1180 call to a possibly undefined method THE

View 11 Replies

ActionScript 3.0 :: Make A Separate File Instead Of Putting It On Frame?

Dec 7, 2010

Basically I am making a flash website and it is due in next week and I can get a gallery working by putting the actionscript onto a frame inside the flash file however I was just informed that I must make a seperate action script file instead of putting it on the frame.[code]...

View 1 Replies

ActionScript 2.0 :: Putting A GoToAndStop On The _down Frame In The Actual MC?

Nov 21, 2002

I have managed to script the swap depth AS into my movie, however, I have come across this problem.

I have three MCs on the stage acting as buttons. On rollover, the expand and slightly cover this other MCs. This is fine as long as that particular MC is on top.

So, here's what I did:

_root.button1.onRollOver = function() {
this.swapDepther(button2,button);
};

this works fine except it only does it once. I need to do it everytime they roll over.

I tried putting a goToAndStop on the _down frame in the actual MC, but it didn't make a difference.

View 1 Replies

ActionScript 3.0 :: Put Actions On Specific Frames To Make It Stop When It Reaches The Middle Of The Animation

Jun 18, 2009

basically on the stage I have my Menu movieclip which is linked to an actionscript class called Menu. Within this I have another movieclip, not linked to actionscript, just a plain old movieclip.

This movie in question is a dialog box, and contains an animation for it popping up, and then going away again. I'm trying to put actions on specific frames to make it stop when it reaches the middle of the animation, then when "ok" is pressed the animation will resume and it disappears again. However the actions on the frames don't seem to be getting executed. I tried putting "this.stop();" on the middle frame, and have since put "trace("hello?");" on all kinds of frames but it doesnt seem that the actionscript is getting called at all.

This is something for work so I don't really want to start sending the .fla file around, but instead is there anything I should know about things which could cause the frame actions to not be executed?

View 2 Replies

ActionScript 1/2 :: Set Frames To Play Frame 1, Frame 3, Frame 5

Mar 13, 2011

I hope I can ask this correctly. I'll paraphrase.
 
press_mc.onRelease = function(){
mover2_mc.play()};
 
This is a snippet of some code I'm working on. Currently I have a mc that you press that plays another mc. That mc that reacts has 5 frames, each frame with stop(); on each frame. I do a normal play code because it lets me play through and cycle back to frame 1 after frame 5 (so if I click the mc it eventually cycles back to the first frame and starts the process over again). If I do a nextframe it stops at frame 5, so that's why I use play.
 
press_mc click on it and it tells mover2_mc to advance a frame and recycles back to frame one to redo the process.Can I tell press_mc to play and skip a frame or to have it play a list of frames that I tell? I can't do a _currentframe +2 because it'll halt at frame 5.

View 6 Replies

ActionScript 1/2 :: Flash Game - Putting Each Armor And Update On A Different Frame Inside The Player Movieclip?

Jan 29, 2011

I am trying to create my first semi-serious flash game. The problem I am having is I want to be able to click a button in the players inventory to equip a different armor to the player, and have that armor work in the game on the same movieclip(Player) without having to re-make all the attacks and moves etc. for each change on another movieclip. My ideas are extremely novice like putting each armor and update on a different frame inside the Player movieclip and then doing a gotoAndStop to the frame. Though that may work I don't know how to goto a frame inside a movieclip. I would like to control this using as much code as possible.I would paste my code but I don't have any code for this part of the game so far. I have tried some simple coding but so far I cannot get the pieces together.

View 1 Replies

Frame Jumping - Click On Button 1 > Plays Frames 10 - 15 > Goes To Frame 20?

Oct 11, 2010

I have 5 different buttons for the navigation on my flash website.The first page is on frame one.When you click on any of the 5 buttons I want it to play frames 10 - 15 before moving to which ever frame the button 1-5 corresponds to. So:

Click on button 1 > plays frames 10 - 15 > Goes to frame 20
Click on button 2 > plays frames 10 - 15 > Goes to frame 30
Click on button 3 > plays frames 10 - 15 > Goes to frame 40 etc

How do I make this work?

View 3 Replies

Extended Actions Frame Too Far (F9)

May 31, 2009

Don't ask me how, but I've made my Actions Frame way too long and I can't drag it up high enough to size it correctly. Consequently, I'm not seeing the end of my code without adding a whole bunch of empty space.

View 3 Replies

ActionScript 3.0 :: Stop All Actions In Frame?

Apr 30, 2009

I have a movie clip intro in frame 1 that skips to frame 2, contained in this function:

Code:
skipIntro_MC.addEventListener(MouseEvent.CLICK, introClick);
function introClick(pEvent:MouseEvent):void{
if(skipIntro_MC.visible == true && pEvent.target == skipIntro_MC)

[Code]......

Am I right in thinking this is happening because it's still trying to execute actions that were happening in frame 1 (fading in of movie clips using transitions) when it goes to frame 2? If so, how do I stop these actions so this error doesn't occur?

View 2 Replies

ActionScript 3.0 :: First Frame Of The Button Actions?

Mar 3, 2010

This is killing me, real simple. I have an mc that has 12 buttons on 12 layersall btns have alpha tweens for 10 frames so the appear like thisbtn 1 alpha fr 1 to 10btn2 alpha fr10 to 20btn3 alpha fr20 to 30 and so on.
 
at the end of the clip there is a stop.

[Code]....

View 1 Replies

ActionScript 3.0 :: Frame Actions On A Child?

Jul 13, 2009

This is just a stripped down version of my problem that im using for troubleshooting purposes. I thought id try and make up a basic script to get the core of it working and then apply it to the file that im having this problem with later just to simplify things.So what im trying to do here is that ive got a MovieClip in my library called mc_brian that ive exported for action script with the class of Brian. The mc_brian movie clip has 2 frames, both with stop actions on them.So ive created my variable newBrian and loaded the Brian class into it, positioned it and added it to the stage via the addChild display object.Then im assigning newBrian an instance name and tracing the instance name, which of course returns "brian1":

Code:
var newBrian:Brian = new Brian();
newBrian.y = newBrian.x = 100;

[code]......

View 1 Replies

ActionScript 2.0 :: Stop Actions At Certain Frame?

Aug 13, 2009

My flash movie has the following actionscript which makes several leaves fly across the screen....I would like to be able to stop this action completely once I get to a certain frame within my movie....

ActionScript Code:
kNbrLeaves = 30;
kLeafLayer = 100;

[code].......

View 3 Replies

Actionscript 3.0 :: Add Actions To A Button Not On Frame 1?

Jan 15, 2010

I am using an external .as file for my code. How do I add actions to a button that is not on the stage but its on another frame in the movie (one that user access later). What is the best practice to add actions to items not present at the start?
Of course I could make another copy of the button on frame 1 and add it off the stage in the invisible part. This is what I was doing till now. IS there another way to do this, a more ethical way?

View 2 Replies

ActionScript 3.0 :: Can't Select Frame In Actions Panel

Oct 29, 2011

For some reason, I can't select the current Frame in my actions panel. Therefore, all actionscript ends up in Frame1.

View 4 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 :: Stop The Actions From Being Carried Over To The New Frame?

Jun 20, 2011

I have an event listener for a mouse click in one frame, then I go to another frame.There are no action so mouse clicking should not do anything, yet for some reason clicking the mouse does the same actions that the previous frame had.How can I stop the actions from being carried over to the new frame?

old frame:

ActionScript Code:
import flash.events.*;
stage.addEventListener(MouseEvent.CLICK, lakemiddle)

[code]...

then in frame 16:

ActionScript Code:
stop();

I want mouse clicking to do nothing on frame 16.

View 3 Replies

ActionScript 3.0 :: Enter Frame Not Performing All Actions ?

Mar 26, 2012

I had a simple swf with enter frame event that would move an object. everything worked ok , then I changed the framerate from 12 to 24fps. No everything is still working ok, execpt the movement in the enterframe event seems to be working at 12fps still...

ActionScript Code:
function performonenterframe(evt:Event):void{
character.x += 5;
trace (character.x);
}

the trace now would give me 5,5,5,10,10,10,15,15,15 etc...so the event is kicking in every frame but it is moving the character every third frame only...

View 2 Replies

Actionscript 3.0 :: Execute Actions That Were Happening In Frame 1?

Apr 29, 2009

I have a movie clip in frame 1 that skips to frame 2, contained in this function:

Code: Select allskipIntro_MC.addEventListener(MouseEvent.CLICK, introClick);
function introClick(pEvent:MouseEvent):void{
if(skipIntro_MC.visible == true && pEvent.target == skipIntro_MC)
{

[Code].....

Am I right in thinking this is happening because it's still trying to execute actions that were happening in frame 1 (fading in of movie clips using transitions) when it goes to frame 2? If so, how do I stop these actions so this error doesn't occur?

View 1 Replies







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