ActionScript 2.0 :: One Function To Do Two Commands?
Nov 17, 2009Is it possible to have one function do two things?[code]...
View 3 RepliesIs it possible to have one function do two things?[code]...
View 3 RepliesHow can i shrink the following code, so that I dont need to write a function for each single button?
Code:
_root.project1.onPress = function()
{
projects_counter = 0;
move();
[code]...
I've had flash for a long time now but I've only decided to take a good look at it recently. I was looking around the net for tutorials and the like when I came across an interface that was only 50k by Synez. I don't know if you guys have seen it, but it looks larger than 50k to me, yet it's not. I downloaded the .fla file and looked at what the designer used the if tag a lot on the buttons and even certain frames. I guess this way he didn't have to remake anything and this contributed greatly to the file size since he reused existing movie clips.
Say for example that I make a movie clip where the buttons shoot out from nowhere. From this movie clip, I want to target another movie clip, the one with the content on it, without having to add anything to the buttons' movie. know how to use the "if" tags.
(AS2 - FLASH8)
I have BUTTON_A inside MOVIECLIP_A on frame 1 this script on BUTTON_A is:
//goto the root and goto frame2
on (release) {
_root.gotoAndStop(2);
[Code]....
THE PROBLEM: I cannot get flash to do both commands from BUTTON_A. When BUTTON_A is clicked, its supposed to goto frame 2 AND show a blue square (just a simple graphic) AND loadMovie into the container 'MOVIECLIP_B'
I can't seemed to get both commands to work simultaneously. DId I write this script incorrectly?
The execution of JSFL files seems to have slowed down in Flash CS5. Or, at least, the updating of the display has been severely slowed down. I have a command I use all the time -- so much that I don't even think about it -- that worked fine in CS4 and earlier, but in CS5 it seems to execute too slowly. My command is a replacement for the "Step Forward One Frame" and "Step Backward One Frame" commands in the control menu (the "<" and ">" keys). I wrote them so that the selected symbols remain selected when going to a new keyframe. Of course, I use this all the time just like I did with the original "<" and ">" keys, and they need to run fast enough that I don't notice their execution time. They don't do that much processing at all, so it really shouldn't be a problem.
I also wrote some functions for profiling, and they indicate that the command is actually running in a reasonable amount of time (around 50ms). When I run it again immediately, though, the execution time balloons to about 300ms. Not only that, but in both cases the display takes its sweet time updating itself. It seems to wait until all activity is finished, and then updates. This means that when I execute the command repeatedly (keyboard-scrubbing the timeline) I don't get to see the current state of the stage until I stop completely and wait for it to update.
As I said before, I never had trouble with this in CS4 and earlier. So my question is: is there any way to tell Flash to update its display in a command, so that I don't have to wait for Flash to get around to it? Relatedly, is there any way to give the javascript interface a higher priority so it'll execute commands faster? keys). I wrote them so that the selected symbols remain selected when going to a new keyframe. Of course, I use this all the time just like I did with the original
We have a web-framework with Flex and Java, whose basic functionality is to execute commands at the background(Unix) and parse and send it back to the client(Flex). This works fine for all silent commands.
We are using Runtime,process to execute commands at java side on request from flex side. The same we need to do for interactive commands/scripts as well.
Does anyone know if it's possible to use SMTP commands through actionscript?
View 4 Repliesits possible to have Flash commands in XML? I want the text "continued" in an XML file to have the following command:
_root.dealWithPages(_root.menu_xml.firstChild,_roo t.menu_xml.firstChild.childNodes[0],"noclick");
but this needs to be in the XML file because the text could appear anywhere in Flash.
I'm trying to reset my flash movie from inside toolbook by sending a variable to flash. I could have two problems: either flash doesn't understand toolbook or my actionscript is just wrong. How should I recieve a the command from toolbook? I've tried alot of different things.
View 1 RepliesCan we run command prompt commands (like copy, rename etc) from an AIR or flex application?I thought of creating a bat file and running it using fscommand, but that does`nt serve my purpose.
View 1 RepliesI would like to execute a CMD command from my flex application programmatically. Something like
> mediaplayer.exe "mySong.mp3"
I also tried using fscommand but was not successful. While googling I learnt that its not supported by AIR. I would like to know if there is any other alternative for executing the commands.
I am beginner in FLEX programming , I am trying to implement a very simple LOGIN system using PHP, FLEX, MySQL.
protected function button2_clickHandler(event:MouseEvent):void
{
var create_new_user:Users= new Users();[code]..........
I have added the "alert.show" to check the sequence , it was really strange to find out the it is executing "6,5,4,3,2,1"..?? Which mean user is created before checking the verification result?
If I use lockroot to keep a loaded movie clip from passing it's variable to the parent movie clip, how do I pass commands to the parent mc?[code]...
View 4 Repliesim trying to make a text box in flash... soo when someone types something in one line and hits enter... the line gets executed... how do u do that?? and plus I want that text box to send commands to IRC basically how can i execute irc commands in flash....
View 3 RepliesI'm making a CD flash projector that exectues on the autorun script of a musician's CD..Anyways, I've gone around and figured out how to disable menus when the movie is running but still the user had full control to resize the window. Does anyone know of a ocmmand that will restrict the user access to window resizing?
View 1 RepliesI have a .swf that opens in a popup. At the conclusion of the clip, I have a button. I would like the button to redirect the parent window and close itself.
[Code]...
how you can pause an actionscript code? I've found posts which explain how to pause animations, but none on how to pause actual actionscript commands .A quick example would be to make a box increase in size (which was done through AS). But when it gets to 100 pixels wide, i want it to pause for 3 seconds before continuing again.
View 7 Repliesis there a site out there that has a translation from all the common AS2 commands?I'm just learning AS3 now and i have no idea how to do the basic things such as _root.mc.loadMovie("asd.swf"); anymore
View 6 RepliesI'm trying to get into flash game developing (without a programming background) and for my first project, I thought creating a simple game like Text 4 Dead (or Don't **** your pants) to be a good bet.Unfortunately, I don't know how to start it. Anyone has any idea how the developers of the mentioned games did it? Did they just created a bunch of frames on the timeline and every time someone writes the right words on the prompt it takes them to the next frame?And how do you create a prompt itself to accept the commands and guide you around the game?
View 4 RepliesI have a clip with one FLVPlayback component and several buttons which load different flvs into the component. If you click one button, then quickly click another button before the flv is ready to play from the last button, it tries to load both, and the component disappears.I put a trace to print out the source I'm loading, and a trace on the Ready event to tell me what the source of the component is, and I get something like this.[code]I should only get the second ready trace, because loading the second vid should override the loading of the first.So is there some way to kill the loading process before loading the next vid? I tried closeVideo Player, but I'm not using netStream, and I only have one video player, so I don't want to delete it.
View 3 RepliesI have a Game swf that uses keyboard Listeners. They workjust fine when the swf's played directly. HOWEVER, after the Game'sbeen loaded into a parent Preloader swf - which is playing from anhtml - , the keyboard Listeners don't function at all.In the Keyboard Listeners do I have to reference the parent?
View 2 RepliesI am doing a flashlite project (AS2) for an embedded application and am having trouble figuring something out. I want a single instance of a menu button that I can move with keyboard cursor presses to specific locations on the Y axis. Figuring out that part was easy but I am stumped on adding multiple commands to the same button.
The initial script I am working with is:
on (keyPress "<Down>") {
import mx.transitions.Tween;
import mx.transitions.easing.*;
var xPosT:Tween = new Tween(high, "_y", regular.easeOut, -234.8, -186.8, 6, false);
}
[Code].....
To tell it that if the button is at -186.8 go to -135.6. So obviously I am having trouble using keyPress "<Down>" twice. What would be the best way to approach this? I would like to have numerous keyPress "<Down>" and keyPress "<Up
I am trying to find out if it is possible to a) create a semi transparent box in flash, b) motion tween that box into place, c) subsequently use it to run forms and PHP scripts (connect to a MySQL instance, ect). I know that an exact answer to c) will be long and complex, so a simple (general) yes or no will suffice... but if someone could point me in more detailed direction with a) and b), If you need to see the actual project I'm working on, or if I need to clarify my questions,
View 1 RepliesCurrently I'm working on a platform type game. I have a for loop in place to check weather or not the players feet are touching the ground. I had this;
[Code]...
This works fine only if one of the floors exist(IE if floor1 is on the stage, but floor2-5 aren't); So to try and counter it I tried using;
[Code]...
But to save myself time, and to give myself the ability to add floors without altering more then i<5 to the amount of floors I have, I would prefer a easier method hopefully something to do with for loops.
I needed some guidance on how to use FlexUnit 4 within Flash Builder,to unit test a Parsley-frameworked Flex application.I have tried lookign at one or two sites but with no avail.
View 1 Repliesso iv been using the Key.IsDown commands to change the yscale (of something), but i am at a loss at getting the yscale (of that something) back to the starting scale when the key is released.
View 3 RepliesSo I've spent alot of time building something in Flash that is rather complex and many competitors would find extremely useful if they could get a hold of it for free. I'd like to implement some protection.
The project has a top-level swf sending commands to a loaded swf. That 2nd-level swf loads five or six other 3rd-level swfs.
The 2nd level has the bulk of the actionscript. I would like to protect the functionality. It also contains some vector-based MCs that I don't want anyone to be able to rip. The 3rd level swfs are vectors only, and again, don't want anyone to be able to rip them.
The top-level is the least important as it mainly acts as a loader and commander, but it does load in comma-delimited data that I'd prefer was not publicly available.
[Code]...
i'm teaching myself bits and pieces of actionscript by downloading movies and customising them, or trying to :P
[Code]....
I have this code on a button that relates to AS elsewhere in the movie (this works fine, BTW):[code]and I want to add the following to the same on (release) command:[code]But I don't know the proper syntax to make both work.
View 12 RepliesMaybe I just such at searching.tell me where I should start for researching the following.I want to create a "command" (JSFL i think) that has a stored AS in it so when I run the command it will type the AS in the AS panel.
View 3 Replies