ActionScript 3.0 :: Perform A "save Target As" Function ?
Mar 18, 2009I cannot find a way to perform a "save target as" function the same way you can with simple HTML.
View 2 RepliesI cannot find a way to perform a "save target as" function the same way you can with simple HTML.
View 2 RepliesI have a function that load an image from web, and change the image size inside an iterative loop. There is a loder and a listener on the loader for the loading to be complete :
for (var i:uint=0; i<=10; i++) {
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); function onCompleteHandler(evt:Event) { .// change the size of the image//}
// other instructions...
}
I want the program execute " other instructions" but only after the image is fully loaded and The size changed
I'm trying to perform a function when a user presses the up or down arrows on the key board. not having any luck.
ActionScript Code:
KeyListener = new Object();
KeyListener.onKeyDown = function() {
[code]...
I want to perform an action if a function is being used. If that function is being used then I will use another function, something like:
if(a.add){
a.mult;
}
That's what I want to do, but I don't know how to. The other thing is that when I use if , else if, with a text input as a parameter, I can't view the action of the if statement in a dynamic text field, even though I did write m.text=b, where b=a.suma.
The file consists of 3 buttons and 3 input fields. Clicking either of the first 2 buttons will place a specific number in one of the 2 corresponding input fields. The third button adds the previous 2 values and displays the result in the 3rd input field. The fields themselves are uneditable and only for displaying the numbers. My question is what is the correct listener/function to have the "total" function perform automatically when either of the first 2 text fields change in value.[code]
View 2 RepliesI am new to the concept of Bitwise operations, and was messing around with some examples today. Everything seemed clear up until the point I tried to make a function to perform a circular bitshift on a uint:
private function rotateLeft(value : uint, shift : int) : uint {
if ((shift &= 31) == 0)
return value;
return (value << shift) | (value >> (32 - shift));
}
I was trying to shift a colour value (e.g. 0xFF0000) and expecting something along the lines of 0x0000FF, when in actual fact I was getting 0xFF000000 (which is correct, due to the length of a uint) - the most significant bytes are for the alpha value.
Is there a way to add an EventListener to a button and make it execute some action when it is clicked without calling a function?
In other words if I have three different buttons and I want to make an action depending on what button was clicked, something like.
If button 1 is clicked do this, if button 2 is clicked do this, if button 3 do this.
I know a different action can be taken using an eventListener and a function assigned to each button but I'm trying to understand more about AS3.
I was just wondering whether it was possible to perform a function after a period of time.like +2 to hp every 6 seconds.
View 2 RepliesAs I understand the save() method in fileReference only works with flashplayer 10. But is it possible in flashplayer 9 to get a "save as" dialog box when I on a btn target a .jpg file on my server?
View 3 RepliesWhen trying to target a MC from within a function in CS3, I often run into problems though I still can't put my finger on it. When targeting the movie clip outside of a function (in this case I'm populating some dynamic text fields) everything is fine. In those cases, I use "this." in front of the MC name. I've tried that syntax and the the MC instance name without "this." within the function and nothing. So I seem to be missing something fundamental about AS3.
View 10 Repliesi'm trying to target a function in one class from another. i'm able to call the function using(public static function imagecount()) but i can't a variable out side of that function. when i do i get this error:
1120: Access of undefined property _imagecount.
so below from call 'person' i want to call fucntion 'imagecount' in class 'model'. the call works but when i try and define a variable in class 'model' that is incremented in the 'imagecount' function i get the above error. it seem that my function has to be of type public static to be accessed from the other class.
///////////////// model class
package com.model
{
import flash.events.*;
[Code]....
ActionScript Code:
import gs.TweenMax;
import fl.motion.easing.*;
var where:String
buttongroup.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
buttongroup.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
[Code] ......
'm trying to break out stuff that happens on a mouse click into a function so that function can be called at another time. here's what i'm trying to do:
function itemClicked(e:Event):void {
passoff(e.target);
trace(e.target.name); //menuItem1
[Code]....
the above is obviously not working but i'm wondering how this should be done.
What I'm trying to do is have a website where there are menu buttons on the sides and when you Mouse Over any of the buttons, the picture in the middle changes. Ideally I'd like to set it up so that the image in the center stays until the next button is touched and then it is removed and replaced with another button. Now I could manage this inside the timeline, but it would take a very long time so I'm trying to figure out how to do this with AS3.This first bit of code I used was as follows:
Code:
home_btn.addEventListener(MouseEvent.MOUSE_OVER,HomeShow);
home_btn.addEventListener(MouseEvent.MOUSE_OUT,HomeHide);
[code].....
How can I combine the following functions and still pass a different string to the buildUI(); function?
I have two functions that do the same thing only at the end they both call a function and pass a String value to the function. This string value is the only thing different.
Below is are my eventlisteners and functions as they are now:
female_start.addEventListener(MouseEvent.MOUSE_DOWN, startFemale);
male_start.addEventListener(MouseEvent.MOUSE_DOWN, startMale);
//FUNCTIONS THAT DO THE SAME THING AND BOTH CALL buildUI BUT PASS A DIFFERENT STRING.
[Code].....
I made a flash site and one of the pages has drag and drop functions with drop target actions, so that text appears once dropped onto a target.It works fine but when I have it loaded inside an external editor, the drop and drag still works but the drop target function stops working.
View 0 RepliesI've created an empty movie clip on the stage called 'photographs', to which I've attached a movie which I've given the instance name 'p1_mc'. This movieclip contains another with an instance name of 'p1_mc_base', which in turn contains a third with an instance name of 'close_btn'.
I need to target 'close_btn' to call an onRelease function. I'm thinking the path would be:
_root.photographs.p1_mc.p1_mc_base.close_btn
which is borne out when I list the objects in the movie, but I can't get it to work. I've used getNextHighestDepth() with the createEmptyMovieClip and attachMovie functions.
So lets say I have a online game where I will have everything that is going on in the game, assigned to variables. I want people to play the game from their own computers through the website and I want them to be able to save and load their place in the game.f this is the first time they have saved, it will ask them to make a login and a password.ll of the data should be stored on my server
View 3 RepliesI created an array with movie clips now how can i target one movie clip with event handler function . so that when i clicked on one movie clip a message should be displayed
View 4 Repliesdoes anyone know if it's possible to target values stored in an array in a function from anywhere in a movie? e.g var Pressed:Array = item trace(Pressed)
if i trace the Array name within the function it spits out values, but when i try and access the Array from outside of the function it doesn't work.
I need to feed the path of a target to a function and it needs to rewrite to set a value to it. example below
[Code].....
Basically it works if it's only one target name with no previous/subsequent targets like path1 works but not path1.box is there any way to fix this?
Im wondering if the LoadVars.SendAndLoad()-function can target a particular frame in a webpage as can the LoadVars.send()-function?
View 2 RepliesI have use for button Save this function:
Code:
private function btnSaveHandler(e:MouseEvent):void{
dispatchEvent(new ControlPanelEvent(ControlPanelEvent.CLICK, ControlPanelEvent.SAVE));
But this not work, why?
This animation is for a kindergarten course. I have 6 different colored teddy bears on the
floor and the bears are to be placed on the middle shelf in the room, in no particular order. I have the code in place to drag the bears, and they return to their original location if dropped in the wrong area. Everything works, except I can't make the bears stick to the target area. The target area has to be the same for all 6 bears.
I have developed a game in flash and I am trying to get a save and load function so that the user can come back to the game that they were playing. Can this be done using the Shared Object....
View 2 RepliesI 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()
On the attached exercise, is it possible to stop further items being dragged onto a target when the target box is full?
View 1 RepliesI'm trying to get this function to target myClip_mc and movethe frame head to another frame label.
var counter:Number = 1;
//textBeGone
invisible_btn.onRelease = function(){
counter++;
if(counter % 2 = true) {
[code].....
This is the code i have:
[AS]
this.onEnterFrame = function() {
setInterval(_root["box"+i], bouncer(), 1000);
};
[/AS]
And i'm trying to target "box"+i to play the function bouncer every second. But instead of just targeting what i want, it targets everything on stage, so everything on stage has the function bouncer called :-
How should i change it so it only targets what i want?
What is the difference between target and currenttarget in flex?What is the difference between Target and Current Target in Flex especially in mouse events.
View 2 Replies