ActionScript 2.0 :: Save Time And Space With Functions?
Jan 12, 2011I was wondering if there is something that I can write (a function? I don't know what they are or how they work ) so that I don't have to rewrite code. [code]...
View 1 RepliesI was wondering if there is something that I can write (a function? I don't know what they are or how they work ) so that I don't have to rewrite code. [code]...
View 1 RepliesI can't seem to override a custom name space function, flash will not accept it. Here's my classes, very simple:
Code:
package {
import flash.display.Sprite;
public class Main extends Sprite {
public function Main() {
var t1:TestBase = new TestBase();
var t2:TestSubClass = new TestSubClass();
[Code] .....
i've a countdown flash and am reading the currentDate from client side ( user clock on windows ). i need to read the time from html for example and save it on var then strat time from it example: HTML Code:
[Code]...
I've been fooling with this problem since AS2.0 (and shared Objects) and I'm not much closer to solving it, partly because every article I read on it is focused on php and server-side stuff that doesn't apply. How to load a String Array from a txt file in local user space (the folder from which the .swf is run). What I need to know: The easiest way for the user to save/load a file. The file has to contain Objects and Arrays reflecting his current status in the game. The goal is to avoid non-Flash apps and languages, and external Classes if possible (I do everything right in the main fla). I don't mind that the user has to initiate and approve the upload/download.
View 1 RepliesI need to do a button system with 8 buttons. I need that only one be visible for each space of time of the month.
Example:
Button 1 - day X to day Y
Button 2 - day Z to day W..
(...)
I'm working on a project for school which is requiring me to make a game using Flash and ActionScript 3.0. One of the tasks I have to do is load an external XML file that will be displaying questions and answers. I've looked at google to find simple scripts for loading XML, one example being below:
Code:
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
[code].....
I have just started learning AS3 (2-3 weeks) and I have to say its very enjoyable!I am trying to make a function that pulls in values to save me writing 15 separate functions!I have a "street mc" which has 15 "house mc's" inside.When the user hovers over a house I want the resident to appear above the house.The house instance name is house1 and there is a mc in the library linked using the MrsRoy() class.This is my code so far:
Code:
var house1Res:MovieClip = new MrsRoy();
function resIconIn(e:MouseEvent):void{
var currentHouse = "street." + e.target.name;
var currentRes = e.target.name + "Res";
[code]....
I get the error:
TypeError: Error #1006: value is not a function.
at Dignity_drive_fla::MainTimeline/resIconIn()
Is there a way where I can save and debug a file in flash cs3 with combo keystrokes?I'm running cs3 on a windows computer and I usually do ctrl+s to save and then do ctrl+shift+enter to debug... and I was just wondering if I can combine these 2 actions with one combination of keystrokes.
View 1 RepliesIs there a way to compare running time of functions to find out which one runs faster? In Flex Builder, there's the flex builder profile that monitor performance and speed of functions. Besides using AS3, is there a similar tool in Flash Pro CS5 (or if there has always been one in lower versions)?
View 5 Repliesi am trying this withou succes
Code:
curr_item.onRelease = DelegateFD.create(this, generateSubMenu, curr_menu, "submenu_mc", curr_item._x, 225, 1000, curr_item.node_xml);
curr_item.onRelease = DelegateFD.create(this, releaseMenu, curr_item, curr_item.gotoURL, curr_item.pageTitle);
But only the last function releaseMenu is being executed
I use FMLE to publish h264 video to FMS , my server side code (main.asc)[code]...
View 10 RepliesI am looking for the script to save image or pdf from swf in real-time.
View 0 RepliesWithout getting in to the specifics, I have a .fla file that has several functions that animate movieClips already present on the stage.
When I compile/view the SWF while working on it, the functions only "run" half the time. The other half of the time, Flash never runs the functions, it just pretends the call never happened. Sometimes they work, and sometimes they don't. I have a feeling it may have to do with Flash's garbage collection, but I don't know how that works.
I was thinking can you call multiple functions at one time Like instead of
[Code]....
I now know that it is impossible to save a swf over a virtual server (in real time) which has had its text changed dynamically. But does this apply to webcam video? What I mean is, if I allow someone to use my app on the internet, and this app allows them to record a video using their webcam, can they then save this swf to their computer?
View 1 RepliesI have a Flash Professional CS5 project in Flash Builder 4, i'm trying to find a way to prevent it from publishing the FLA everytime I save, I only want it to publish when I actually debug or run it.
Is this possible, it's driving me nuts, I can't do inline checking without saving, but saving means I have to wait for the FLA to publish.
so here's the function on main stage:
function slideImage(btnNum:Number)
{
trace("scrolling image");
trace(btnNum);
[Code].....
How can i acess slideImage function on the main stage. in AS2 _root.slideImage(btnNumber); would work. How Would I do this in AS3?
[URL] I got partial success with the tutorial above, but couldn't figure out a few things.
1) How to save the date and time to the database? Based on web search result on how to find date or time in APS, I thought I could do
[Code]...
but the ASP generated errors on the 2 lines.
2) When executing the file (getURL("http://yourSite.com/processForm.asp",0,"post");
}), it always opens the processForm.asp file in a new window. Can it be executed in the same window or just being hidden?
The tutorial is old, and I wonder if there are new ways to do the things with CS4 or CS5?
I have a problem with two functions. This is the story: the user has to press the space button on keyboard when he sees something on screen, then the "rightClick" function is called. If he presses the button when there is something else on screen that is a wrong answer (function "wrongClick" is called). The problem is that when the user presses the space button both function run at the same time.
This is the call of the wrongtClick function on frame 5
stage.addEventListener(KeyboardEvent.KEY_DOWN, wrongPress);
This is the call of the rightClick function on frame 10
stage.addEventListener(KeyboardEvent.KEY_DOWN, rightPress);
Both function are very simple:
function rightPress(event:KeyboardEvent):void {
scorenum += 1;
trace ("Right:",scorenum);
} function wrongPress(event:KeyboardEvent):void {
wrongnum += 1;
trace ("Wrong:", wrongnum);
//and plays a sound too
}
I just finished a simple music player... For testing purposes. I upload it in the following address:http:[url]....with 10 music songs that I had recorded from radio stations(added the last 2 twice for testing).The problem is that when a song has totally loaded, stop action taken needs about 1 second to be applied!I.e. When I press "STOP", the sound continue to play for 1 sec before stop. When I push "pause" it takes one second for the music to stop!
However when using resume (second time pause) the sound starts instantly! Thus I guess there is an issue with stop()function of the SoundChannel object that I am using to stop the sound. Also notice that when unpause the music, it continue ~one second before the last sound - which means that I saved the soundChannel.position number (and also call soundChannel.stop()) in correct time, but it didn't stop immediately - bug!?
This only happens when the application runs through a browser(plugin v. 10) - programmed in CS3.
PS1. Notice that ,this also happens when I change Volume too. Thus because Stop and Volume are parts of SoundChannel, I guess there might be a bug with SoundChannel in online plugins..... :/
PS2. Notice that ,this also happens when I close the browser (firefox). Even if browser is closed the music continue for 1 sec the same way as when pressing stop!.. Thus I guess it's flash bug!...
I've designed a painter program where the user can select different colours and 'paint' a custom design on screen. What I would like to do is incorporate a 'Save' button which takes a snapshot of their drawing which they can then save to their computer.
View 0 RepliesHow do we save file locally in Flash (ActionScript 3) without displaying dialog. I know we can use the following code to save file locally but it prompts Save dialog. I don't want this dialog while saving file locally.
[Code]...
I have a series of calculations i'm doing over a bunch of objects stored in a array. Each function is pretty CPU demanding but if you only run one function, it just works fine.
[Code]...
I've got a project thats getting a bit big, so Im taking the actionscript out into separate as files. I want all the basic functions to be in BasicFunctions.as and the make a library for more specific functions. I find that a lot of people use the import statement but I cant get that to work with a simple Hello World trace, yet the include statement works fine (see attached). I understand that import/include work differently, but which is the better method? If import, then is that heavier to work with. Any rate, what's the best way to organise code when it gets to the 1000+ lines?
[Code]....
I'm trying to find a way to have global functions in my as project, similar to how flash does with stuff like the util functions (describeType()...), where you can just call the function wherever you need it. For example:
[Code]...
So when I call Test(), it prints out "hello world" fine. My problem comes in that I can't change the name of the Test function, and I can't add any other functions without compiler errors. Is it possible to have a load of global functions in one file, or do I have to split them up into separate files like in the example? Also, I know that I can make a Global class and call static functions like Code: Global.doSomething() but I'd like to know if there's a way to do it as flash does it (describeType(), getDefinitionByName(), etc), or rather, how does flash do it?
Is it not possible to call other functions from generic mouse event functions?
Code:
_root.myButton.onPress = function(){
hide();
[code]......
I have one function that puts text in a text field and makes a button goto a url onRelease.The code is like this:
Code:
item.onRelease = function() {
myButton.onRelease = function() {
getURL("http://google.com", "_blank");
}
talk = this.txt;
}
the only problem is that the button doesn't work onRelease. i think that it is because there are too many functions there, but at the same time,
in this example why the values of (12) and (21,39) are lost at the geo and geo1 functions
[code]...
Can we Bypass the save dialog box of FileRefernce.save()? If not, then Is there any workaround to save a file from web application in Flex without asking user where to save file?
View 1 RepliesI need to create a notepad in flash.here how could i save the file by prompting the save window?
View 11 Replies