ActionScript 2.0 :: Cant Make Function Work

Jun 1, 2004

I was reading Kirupa Chinnathambi's function tutorial and I was trying to make my own function, but it's not working! Here it is:[code]

View 9 Replies


Similar Posts:


ActionScript 3.0 :: Any Way To Make StartDrag Function Work Better?

Jan 13, 2010

When you are dragging a movieClip on the stage, it generally works fine. But if you are performing some calculation or hitTest while you dragging, the location of the cursor and the movieClip starts to go unsynched. For example, in the following code, I am running an ENTER_FRAME handler while you drag a box, and this onEnterFrame_Box method contains a bogus for loop to slow down the process. The drag & drop works snappy if you comment out that for loop... But if you bump up that 100 to something like 200, Flash Player runs quite slow, and the location of the box won't match where your mouse cursor is...

ActionScript Code:
var box:Sprite = new Sprite();
box.graphics.clear();
box.graphics.beginFill(0xCCCCCC, 1);
box.graphics.lineStyle(1, 0x999999);
box.graphics.drawRect(0, 0, 100, 100);
[Code] .....

View 2 Replies

ActionScript 2.0 :: Make E To HitTest F To Get Something Else Function But They Won't Work?

Sep 6, 2011

Lets say that I got movieclips A,B,C,D in my scene and E,F which only come into scene when A hitTest B and C hitTest D.I was able to make the A+B and C+D hitTest functioning properly. But when E,F came into the scene, I tried to make E to hitTest F to get something else function but they won't work.# note that there is some short animation before E & F come into scene.I am pretty sure all the instance names are named properly.

View 5 Replies

Professional :: Make The OnMouseDown Function Also Work Within The MovieClips?

Jun 15, 2010

Is there a way to make the onMouseDown function also work within the MovieClips area in this code example?  It seems like the two functions are conflicting.
 
attachMovie("nutrition","nutrition",4,{_x:715, _y:370});
nutrition.gotoAndPlay();
nutrition.onPress = function():Void{

[Code].....

View 2 Replies

ActionScript 2.0 :: Listener In Order To Make OnRelease Function Work?

May 20, 2007

Do I have to use a listener in order to make the onRelease function work? Right now it doesn't and I think it's because the png isn't loaded before the onRelease function is invoked.[code]

View 3 Replies

ActionScript 2.0 :: Make A Graphic Visible When "complete" Cuepoint Is Detected, But Function Doesn't Work?

May 24, 2007

I'm using Flash 8 (in case you need know what version I'm using).There's three flvs I have assigned a cuepoint, "complete". The goal is to make a graphic visible when "complete" cuepoint is detected, but this function seem doesn't work, any feedback on function?:

Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);[code]....

View 1 Replies

ActionScript 3.0 :: Width Doesn't Work - How To Make It Work

Apr 21, 2010

I have a button object that I need to scale to align with the variable width of an array of images.However, when I set the width in code, the button does not actually become that width. Tracing out the width gives me the correct value, but on screen.. it's off.

I've proved it to myself by scaling the same button object manually in the properties pane and visually comparing. Both of the buttons below have a width of 410.

Code:
navigatorDown_btn.width = 410;
navigatorDown_btn.x = (stage.stageWidth/2)-(navigatorDown_btn.width/2);
trace(navigatorDown_btn.width); // output: 410

View 4 Replies

ActionScript 3.0 :: Declaring A Variable In A Function: Either The Function Or The EventListener - Doesn't Work

Nov 27, 2009

I have a set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.

[Code]...

View 4 Replies

Actionscript 3 :: Function From A MouseEvent Activated Function Will It Not Work Properly?

Jan 3, 2012

I am working with AS3 to build a very simple mp3 player on my site. So far the play and pause button work fine, but when I try to move the slider then click the pause button, it doesn't pause, and then clicking the play button again causes it to play a new file.I'm assuming that for some reason when I call the playMp3 function from my MouseEvent, it's within an object or something and not at the root, so it's like loading a new sound file, but I don't know how to fix that.URL...

View 2 Replies

ActionScript 3.0 :: Make A Sprite Button With Graphics And Can't Make It Work?

Aug 22, 2011

* I have a flash project called contact

* The document class is ContactClass

I am trying to make a sprite button with graphics and can't make it work. I have successfully added text fields so I know the path is correct. I suspected my code was correct and confirmed it should be, after reading several tutorials showing the process for creating sprite buttons with graphics. Anyway, I imported nearly every class on Earth, but certainly everything which needs to be. Stage is gray and 800x600.The graphics code by itself with appear, but not when linked to the sprite. Also, the sprite won't appear no matter what. Another interesting piece of the puzzle: nothing will trace, not even objects such as textfields which actually appear and function on the stage when I text the code.

public class ContactClass extends Sprite {
public function ContactClass() {
var home_btn:Sprite = new Sprite();[code]....

View 3 Replies

ActionScript 3.0 :: Make Function In To A Static Function And Call It From Other Classes

Sep 23, 2009

this is the function i want to turn in to a static function. just dont know how to make it a static function and call it from other classes. i think this would have its own file.

[Code]....

View 2 Replies

ActionScript 3.0 :: Make A Function Stop A Function?

Jul 1, 2010

ActionScript Code:
myFunct();
function myFunct()
{

[Code].....

Any way to get this to work without using much more code? This is for a function that checks to see if a user is still logged into a website. I need the check to happen every time the user causes certain functions to run, like create topic, submit new post, etc. I could put the code, which is only a two-liner if/else statement in every function, but it would be nice to just call a single function. But that function would have to be able to cause the function that's calling it to return to get it to cease.

View 5 Replies

ActionScript 3.0 :: Use A Function From A Doc Class To Call A Function To Work On In Another Class?

Dec 15, 2009

how do use a function from a doc class.... to call a function to work on in

[Code]...

View 2 Replies

ActionScript 3.0 :: Way Else IF Function Should Work?

Dec 30, 2010

I've written the function below which is called when a button is clicked. I want to change the character image being displayed and change the number_txt variable each time the button is clicked.This works in the first instance (if char 1 is visible it hides it, makes char 2 visible and changes the variable as required). But having done this it wont work the other way (hide char 2, make char 1 visible, change the variable as required)I can only assume I'm missing something in the way the Else IF function should work? If there is a better way of scrolling through 4 or 5 'character' images and updating the variable each time.[code]

View 2 Replies

ActionScript 3.0 :: SetFocus Function Does Not Work

Nov 21, 2008

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="[URL]"
xmlns:ns1="com.something.*"
creationComplete="init();">
<mx:HBox>
<ns1:MyButton label="ok" click="ok_()" id="OKBtn"/>
[Code] .....

View 2 Replies

ActionScript 3.0 :: Can't Get Function DOUBLE_CLICK To Work

Feb 12, 2011

this is my code..RollOver and Out works great, but I can't seem to get function DOUBLE_CLICK to work.

home_mc.doubleClickEnabled=true;
home_mc.useHandCursor = true;
home_mc.buttonMode = true;
this.home_mc.addEventListener(MouseEvent.DOUBLE_CLICK, click_home_mc);

[code]...

View 3 Replies

ActionScript 3.0 :: Button Function Seems To Work Only Once

Feb 19, 2011

When I tell Flash to go back frames the buttons cease to work, in other words, the button only works once. I've tried tracing it to find the problem and when I tell it to go back frames it won't run the function.  I'm using actionscript 3 on Flash CS4.[code]

View 5 Replies

ActionScript 3.0 :: Get The AddCallback Function To Work?

Sep 22, 2011

I try to get the addCallback function to work but I don't get a working result. I allways get a js error 'callback is not a function'. I tried to put it on my local-webserver, to fake a domain name (www.localhost.de in hosts file).
 
Here is my code (the move has the textfield
 
import flash.events.Event;
import flash.events.MouseEvent;
import flash.external.ExternalInterface;

[Code]....

View 8 Replies

ActionScript 3.0 :: TweenLite Function Won't Work

May 30, 2010

For some reason my TweenLite function won't work. Doesn't give any errors, but it just doesn't do anything and thus the onComplete function won't work to continue the script.

[Code]....

View 3 Replies

Actionscript 2.0 :: Making Function Work?

Mar 16, 2010

The Function is:
Code: Select allfunction Click_Die () {
this.gotoAndStop(die111+die11+die113);

[code].....

View 3 Replies

ActionScript 2.0 :: Why Does Trace Function Not Work?

Jul 1, 2004

hive just started actionscripting instead of tweening so be gentle. i use mx 2004 but i cant get the trace function to work.., here is the code form a kirupa tutorial...

_global.myvar=5;
trace (_global.myvar);

why does this not work?i thought it shud display 5.

View 2 Replies

ActionScript 3.0 :: Set Function That Will Work For ALL Variables

May 5, 2011

By chance does anyone know if there is a way to make a set function for my class that will run regardless of what variable is being set? like if someone does..anInstanceOfMyClass.anyVariable="whatever";it will always run function X.I want my code to have a function that runs every time someone tries to set the value of a variable in my class, or create a new variable that does not even exist yet in the class.

View 8 Replies

ActionScript 2.0 :: Allows The Last Function To Work In Alpha?

Aug 30, 2004

I tried using this code because I need some mc to scale, others to fade, and others to move; but it won't work. It only allows the last function to work (in this case alpha).

[code]...

View 5 Replies

ActionScript 2.0 :: How To Make A Function 'mc.function()'

Jul 19, 2005

How do I make a prototype for a function like... mc.attachMovie() , or mc.nextframe(). Know what I mean ? the argument of the funcion is the mc.

View 2 Replies

ActionScript 3.0 :: Possible To Make Function In A Function?

Mar 16, 2011

an example when you might need this? Also what is this output? it hurt my brain

PHP Code:
func1();function func1(){func2(); function func2() trace(this);//[object global] }

[code].....

View 4 Replies

ActionScript 3.0 :: Why Doesn't The Same Function Work From Different Frames

Apr 10, 2009

I'm making an educational software by AS3.I call "part1Act()" from frame1 and everything works very well.But when I call the same "part1Act()" from the frame 58, flash throw me this error.
 
TypeError: Error #2007: パラメータ child 㯠null 以外ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。    at flash.display::DisplayObjectContainer/addChild()    at L_oni_fla::MainTimeline/loadSnd()[L_oni_fla.MainTimeline::frame2:699]    at L_oni_fla::MainTimeline/part1ActT()[L_oni_fla.MainTimeline::frame58:6 7]

I only called the same function from different time frame.The script I wrote is following.
 
//--------------------- code ---------------------------------//
var progressBar:progressBarL=new progressBarL();
var context:LoaderContext = new LoaderContext();context.applicationDomain=appDomain;var ldSnd0:Loader = new Loader();var ldSnd1:Loader = new Loader();var ldSnd2:Loader = new Loader();var ldSnd3:Loader = new Loader();

[code]....

View 9 Replies

Path Function That Is On A Different Time Line For It To Work

Sep 25, 2009

I am trying to link a button via AS but I need to use a function that is on a different time line for it to work. I have no idea how I am going to do.

[Code]...

I am trying to use the "var flvControl" but that function is located on a different timeline.

View 7 Replies

ActionScript 2.0 :: OnPress Function Doesn't Work

Sep 10, 2007

my problem is that my onPress function doesn't want to work. Here�s the script: PHP Code:

[Code]...

the hilite function should let the buttons disable or not, but it just will not work.....

View 1 Replies

ActionScript 2.0 :: Function Doesn't Work According To Path

Jun 10, 2008

I'm programming a dinamic flash/xml website. up until now I've kept the info for the menus and the one for the gallery (the site has a gallery that displays both text and images) in separate xml files. but I'm trying to make all of it work out of a single xml file. I've managed to make the menus and the gallery all go get the info correctly to the xml (text and images), but then I came up with a problem that jeopardizes the whole show: a path inside the xml's onLoad function refuses to work! the code that bears the function has to be placed into the same clip as the clips that contain the text fields to wich info will be passed or it won't do a thing.

supose this is my actionscript code:

Code:
var contentSubMenu = new XML();
contentSubMenu.ignoreWhite = true;
contentSubMenu.load("example.xml");

[code]....

no information is passed to that clip. If the path targets that clip one should expect it to, right? even if all this code is placed on _root, right? well, it doesn't happen...I tried tracing for info that comes from the xml, but nothing is displayed in the output window.

I've attached a zip file that contains a fla file, an xml file, a txt file with the full chunk of actionscript code and the fonts you'll be needing should you decide to take a look (they're only two).

The fla file has been built in the following manner:

_on the right side, the clips that hold the text fields to wich the contentSubMenu.onLoad function will pass info to are directly placed upon _root (so, following the code example from above, it would be like having var buttonList = _root;)

_on the left side, the clips that hold the text fields are down into buttonListSlide_mc and the contentSubMenu.onLoad function is there as well, only commented so it doesn't display anything.

View 1 Replies

ActionScript 3.0 :: GetBounds Function - Does It Work With TextFields?

Mar 10, 2009

I'm trying to get the height of the (external) text in textfields to display them vertically on top of each other with a space in between. At the moment I am adding the textfields with predefined heights, so if item1 is 2 lines and item2 is 4 lines then there is a lot of space between item1 and item2

ActionScript Code:
var my_tf = new TextField();
my_tf.text = "Hello";
my_tf.appendText(" world!");// my_tf.text == "Hello world!"
my_tf.x = 100;
addChild(my_tf);
[Code] .....

View 1 Replies







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