ActionScript 3.0 :: Function Only Works In Simple App But Not In Complex One

Mar 11, 2010

I made a simple app with 2 movieclip symbols containing photos of a butterfly with this actionscript:

import fl.transitions.Tween;
import fl.transitions.easing.*;
butterfly_mc.addEventListener(MouseEvent.CLICK, bigPic);
butterflyHand_mc.addEventListener(MouseEvent.CLICK, bigPic);
function bigPic(e:MouseEvent):void{ new Tween(e.currentTarget,"scaleX",Strong.easeOut, e.currentTarget.scaleX, (e.currentTarget.scaleX * 1.4), 4, false);
[Code] .....

I don't get any error messages but when I click on case1_mc.c1_mc.case1a_mc or case1_mc.c1_mc.case1b_mc nothing happens.

View 11 Replies


Similar Posts:


ActionScript 2.0 :: Highlighting (Simple And Complex) Buttons On Menu

Feb 13, 2006

How do you code simple buttons and complex buttons that show they are on or have been activated? I want my interface to be able to tell my users that they are in a specific area by highlighting the button on my menus. (Just like the navigation menu for [URL]).

View 2 Replies

ActionScript 2.0 :: Loading Complex SWF Into Simple Movie - Slow Performance

Jan 27, 2006

In terms of performance, does loading .swfs into a flash movie have any implications. I've been experimenting with loading complex swfs into a simple movie and the complex .swf seems to perform a lot slower within the .swf than as a standalone. The host movie has no other funcitonality other than as a simple container. Is it in general terms better not to load .swfs into a movie but to code everything inside 1 movie ?

View 2 Replies

ActionScript 3.0 :: Function Works Only Once?

Sep 19, 2009

I have a listener and a function for it on the main timeline, listening for TextEvents from links in a dynamic textbox nested somewhere in the movie. The problem is that everything works only once. I click on a link, it works, click again and it does nothing. I have to reload the objects for it to work again. What am I doing wrong? Do functions work only once when the main timeline is stopped?

View 1 Replies

ActionScript 3.0 :: Function Works Only On The Second Click

Dec 14, 2010

I created what I though was a pretty simple function for a mouse event listener. The funtion goes to a frame in the current movie clip as well as the parent movie clip. For some reason however the first time you click the button, it only effects the parent movie clip. When you click on it the second time, both movie clips are effected. Here is the script,

[Code]....

View 2 Replies

ActionScript 3.0 :: Function Works On Some Objects But Not Others?

Jun 10, 2011

And I don't know how to use the debugger in Actionscript. This is my code. It's in a class called GeoPiece and is being activated when a movieclip of instance GeoPiece is dragged over a movieclip of instance GeoPuzzle. lastObjOver is a place holder and is an instance of GeoPuzzle.

I want the mc from GeoPuzzle to highlight (goto frame "Over") when it is touched over and unhighlight (goto frame lock or out) when untouched. The script works perfectly - unless the GeoPuzzle piece was already locked. For some reason, it then sets itself to null and I can't figure out why.

ETA: The touchevent its responding to is a TOUCH_MOVE attached to the GeoPiece.

[Code]...

View 8 Replies

ActionScript 3.0 :: Works Just In Constructor Function?

Jan 7, 2010

If I pass variable(s) like this in document class action script file(I'm not even sure if I can pass more than one variable):

Code:
ballPointRight = new BallPointRight(ball, xDir, padScreen) ;

And now the BallPointRight's action script file:

Code:
package {
import flash.display.MovieClip;[code]....

doesnt work since it doesnt recognize variables...

View 4 Replies

ActionScript 2.0 :: Function Works, But Not When Called By Interval?

Dec 14, 2009

I have a function ("advance_slideshow()") that ticks a slide show up by one, then it loops back at the end. It works when called from the key listener I set up for debugging. However it does not work when called from setInterval. I added a trace to the function to confirm that it was being called, which it is; it just doesn't work when called via the interval

Code:
//////////////////////////
/* IMPORTS AND INCLUDES */

[code].....

View 1 Replies

ActionScript 2.0 :: For Loop Works In Trace But Not In Function

Mar 9, 2010

I have 20 players in a game and cutting and pasting lots of code except for a few numbers. I have future features that would require over 400 lines of mostly repeated code. So I learned how to use "for", and practiced with a trace command. Traced the results exactly as I thought. However when I apply it to the guts of my function, the movie breaks down. I suspect it's because the function is being called on an EnterFrame command and the for loop I wrote is being executed over and over.

This works when I hand code:
Actionscript Code:
function drill(){GUESS0 = ((guess0min * 60)*1000) + ((guess0seconds * 1000))
GUESS1 = ((guess1min * 60)*1000) + ((guess1seconds * 1000))
GUESS2 = ((guess2min * 60)*1000) + ((guess2seconds * 1000))
GUESS3 = ((guess3min * 60)*1000) + ((guess3seconds * 1000))
GUESS20 = ((guess20min * 60)*1000) + ((guess20seconds * 1000))
//and then 300 more lines of other code}

And then a button later calls this when pressing:
Actionscript Code:
my_MC.onEnterFrame = function(){_root.drill ();
//so _root.drill is continually being called, which is good, because it has all sorts of data that needs to be refreshed, but I think it's screwing with my "for" loop.}

And the following is NOT working.
Actionscript Code:
function drill(){for (i=0;i<20;i++){
"GUESS"+i+" = ((guess"+i+"min * 60)*1000) + ((guess"+i+"seconds * 1000));";}

But when I trace it in a separate test movie, it outputs exactly what I would hope it placed in the code:
Actionscript Code:
for (i=0;i<5;i++){trace("GUESS"+i+" = ((guess"+i+"min * 60)*1000) + ((guess"+i+"seconds * 1000));");}

So at the end of the day, I guess I can trace these results in a test movie and use it to generate what I need, and cut and paste it into the project... but I thought 'for' loops were for saving time AND space. Am I using this code right? Maybe my use of "", or +, or i is misguided?

View 4 Replies

ActionScript 3.0 :: AddEventListener In A Function No Longer Works

Apr 23, 2011

Should that be avoided due to local scope factor? function resizeDisplay() below no longer works

[Code]...

View 4 Replies

ActionScript 3.0 :: Re-setInterval Each Time Function Works?

Mar 19, 2012

I have a function that draws a rectangle on the screen (see createInfoPanel())While drawing rectangle, I am adding 2 text fields on it.But as you may guess, it is adding those immediately. I want to delay adding these text fields, then I want to remove these panels after a while. The problem is, when I set an interval or timer, they won't work after I using once (I had to stop them by clearing/removing, it didn't set them again).Since my panel is being created each time image changes, I need them to work every time image changes.
 
So, I have 2 questions:1- How can I re-set interval each time my createInfoPanel() function works? It won't work anymore after setting and claring once. 2- You can see infoPanel.addChild(titleField); line in addInfoPanel() function. How can I work a smooth animation here? I mean, text appears slowly?

[Code]....

View 4 Replies

Actionscript 3 :: Measure How Long The Function Works

Sep 29, 2011

I am trying to compare the performance of several different algorithms. So created several functions each of them implementing different approach of solving the same task.What was thinking to do is to create 2 Date objects before and after the function runs, and to compare them afterwords.

View 2 Replies

ActionScript 3.0 :: Switch Case Does Not Works With Function

Oct 31, 2010

The switch case doesn't works with function. This is the AS3 code:
ActionScript Code:
var med:Number, mdi:String, op:int, tot:String;
bt1.addEventListener(MouseEvent.CLICK,yardas);
function yardas(MouseEvent:Event):void{
op=1
[Code] .....

View 1 Replies

ActionScript 2.0 :: Function Only Works On The First 30 Frames Of The Scene?

May 11, 2005

I'm making a website to the company that I work and I'm having a problem.The function only works on the first 30 frames of the scene?!?! Strange!Here goes the .fla and if you see the "years bar" doesn't move has the other elements. But if you click on the [M Button] and next on the [P button] it works.Why does not work on the other buttons.

View 3 Replies

ActionScript 2.0 :: Function Works, But Not When Called By Interval

Dec 14, 2009

I have a function ("advance_slideshow()") that ticks a slide show up by one, then it loops back at the end. It works when called from the key listener I set up for debugging. However it does not work when called from setInterval. I added a trace to the function to confirm that it was being called, which it is; it just doesn't work when called via the interval.

[This is Flash 8, AS2]

Code:
//////////////////////////
/* IMPORTS AND INCLUDES */
//////////////////////////
import mx.transitions.*;

[Code].....

View 4 Replies

ActionScript 2.0 :: HitTest Function Only Works On Y Axis

Oct 14, 2003

My hitTest function only works on the y-axis
This is the code....
onClipEvent (enterFrame) {
// _root.speed = speed;
if (Key.isDown(Key.UP)) {
speed += 3;
[Code] .....

View 1 Replies

ActionScript 3.0 :: Graph A Simple Function?

Nov 17, 2011

I have been searching the net for a tutorial how to graph functions. I found one from Barbara Kaskosz, very detailed, and too much scripting. Too much for me. Is there another way or place to learn, or I am doomed, and have to face the music and study her stuff. All I want, is to be able to graph a simple function.

View 4 Replies

ActionScript 2.0 :: Simple Fade In And Out Function?

Oct 18, 2007

function that I can re-use and pass movie clips to and cause mc's to fade in and out?...such as

Code:
function fadeMeIn(fadewhat,fadespeed) {
if (fadewhat < 100) {

[code]......

View 6 Replies

ActionScript 3.0 :: Simple Pad String Function?

May 29, 2011

I thought I would share a simple pad string function I created briefly... I know that there may be other similar functions already out there but I decided to make it anyway. It's basically a ripped off as3 version of the str_pad() php function.

Examples:
trace(stringUtils.stringPadLeft('7',4,'0','left')) ; // Traces 0007
trace(utils.stringPadLeft('whatever',2,'~','left') ); // Traces whatever
trace(utils.stringPadLeft('hi',20,'-','left')); //Trace ------------------hi

[code]....

View 2 Replies

ActionScript 2.0 :: Load Function Works Locally But Not On Webserver?

Mar 17, 2009

I finally finished my game and now whenever my game communicates with my php file/mysql database it fails when the file is being run off the server, but somehow it works fine when played locally.

Here is some sample code:

(This works locally, hence the full url for the load function. But it does not work on the server which I thought was strange.)

Code:
startupvars = new LoadVars();
startupvars.load("http://alexville.com/alexvillenetwork/startup.php");
startupvars.onLoad = function(success){
if(success){

[Code].....

View 1 Replies

ActionScript 2.0 :: Load() Function Works Locally But Not On Webserver?

Mar 31, 2009

I really want to finish this project that I'm working on, but this stupid problem keeps holding me back.

When I try to Load variables from my PHP file on my webserver from my local computer everything goes fine. But when the swf file is actually on the webserver the Load function fails to return any result with no error.

Here is my code:

Code:
Stage.scaleMode = "exactFit";
startupvars = new LoadVars();
startupvars.load("startup.php");

[Code]....

What happens after this code runs is that the text boxes dont get filled with ANY text, not even the Logged In As before the variable. So I guess the "startupvars.onLoad = function(success){" code is not being run.

View 1 Replies

ActionScript 2.0 :: Flash8 Function Works But Not When Called By Interval?

Dec 2, 2010

I have a function ("advance_slideshow()") that ticks a slide show up by one, then it loops back at the end. It works when called from the key listener I set up for debugging. However it does not work when called from setInterval. I added a trace to the function to confirm that it was being called, which it is; it just doesn't work when called via the interval.

Code:
//////////////////////////
/* IMPORTS AND INCLUDES */
//////////////////////////

[code]....

View 7 Replies

Professional :: Function To Search Xml Works Locally But Not Online

Apr 11, 2010

I have a function triggered by a button click that searches through an XML file for an e-mail address (entered in a text field) and returns a match or no match. When I run the swf locally it works fine, but once the site is posted it no longer works. Locally it is connecting to the same xml & php files that it uses online.

View 4 Replies

Actionscript 3 :: Flash - Re-setInterval Each Time Function Works?

Mar 19, 2012

I have a function that draws a rectangle on the screen (see createInfoPanel())
While drawing rectangle, I am adding 2 text fields on it. But as you may guess, it is adding those immediately. I want to delay adding these text fields, then I want to remove these panels after a while. The problem is, when I set an interval or timer, they won't work after I using once (I had to stop them by clearing/removing, it didn't set them again). Since my panel is being created each time image changes, I need them to work every time image changes. So, I have 2 questions:

1- How can I re-set interval each time my createInfoPanel() function works? It won't work anymore after setting and claring once.

2- You can see infoPanel.addChild(titleField); line in addInfoPanel() function. How can I work a smooth animation here? I mean, text appears slowly?

[Code]...

View 1 Replies

ActionScript 2.0 :: Prototype Function Works In Flash Not Online

Feb 2, 2005

I found a cool prototype function here in the forums that plays a movieclip backwards:[code]I have the protoype defined on the main timeline of my main file. I call the function on press of a button from an external movieclip after it's loaded into main.When testing it in flash it works beautifully. When I test it online it doesn't work at all. Other code on the button being called at the same time does work (like unloading a movieclip on the main timeline).

View 6 Replies

ActionScript 2.0 :: Function That Works For Every Movieclip Whatever Instancename The Moviecl

Jan 21, 2007

I want a function that makes every movieclip on the scene thats beeing released to do what�s in the actonscript.My function doesnt woork, is there a function that works for every movieclip on the scene whatever instancename the movieclip has ?

Code:
movieClip.onRelease = function() {
this._alpha=50;
trace(YEAS);
}

View 1 Replies

ActionScript 2.0 :: Prototype Function Works In Flash, Not Online?

Feb 2, 2005

Like the title says, I found a cool prototype function here in the forums that plays a movieclip backwards:

Code:
MovieClip.prototype.backwards = function() {
this.onEnterFrame = function() {[code]...

I have the protoype defined on the main timeline of my main file. I call the function on press of a button from an external movieclip after it's loaded into main.When testing it in flash it works beautifully. When I test it online it doesn't work at all. Other code on the button being called at the same time does work (like unloading a movieclip on the main timeline).

View 6 Replies

ActionScript 3.0 :: Simple Error #1006: Value Is Not A Function

Nov 18, 2011

Well I'm so close to understanding why this doesn't work. First here is the code:

Code:
import flash.display.MovieClip;
stage.addEventListener(Event.ENTER_FRAME,updateGame);
var gameZoneContainer:MovieClip = new MovieClip();
stage.addChild(gameZoneContainer);

[Code]......

If I place "fish_mc" in place of "Items[createItemCounter]", the fish animates but the cookie doesn't. If I put "cookie_mc" instead of "Items[createItemCounter]", the cookie animates but the fish doesn't.

View 2 Replies

ActionScript 3.0 :: Simple While Loop Doesnt Function?

Oct 29, 2009

For each product a label is created determing its category unless a label of that category has already been created before. My while loop is supposed to stop the same label being created twice but apparently it doesnt! My function consists of an array of categories (kategorie[]) and an array of labels that were previously created (previousLabels).

[Code]...

View 4 Replies

ActionScript 2.0 :: Simple GetURL Function Not Working

Sep 8, 2009

I'm modifying an mp3 player by flabell, and try to get some buttons to work. However, I can't seem to get the getURL to work, even though it works in other parts of the script. This is my code:
mc.rate1.onRelease = function() {
trace(this.ID);
getURL("[URL]","_blank");
};

The trace goes through fine. Here is the code that works:
Code:
private function downloadRelease(mc : MovieClip) : Void {
var title : String = mc._name;
var index : Number = Number(title.substring(title.lastIndexOf("n")+1,title.length));
getURL(songsSource[index], Main.getInstance().mcAlbums.linksTarget);
}
I'm on a mac with firefox.

View 3 Replies







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