ActionScript 2.0 :: Regarding A Non-working Function?
Oct 6, 2004why is this working well:
Code:
with(mc){
_xscale = 160;
_yscale = 160;
[code]....
why is this working well:
Code:
with(mc){
_xscale = 160;
_yscale = 160;
[code]....
find out error because mouse down and up function is not working.
View 4 RepliesI'm working on a pretty simple flash application which basically plays a music clip downloaded from a web URL, and makes a stick man dance. I have it all working fine, however, I've used the addChild function on the start button to add the mc onto the stage, however, when I applied the removeChild function to take it off again, I get an error telling me that it hasn't got a caller.Here's the script:[code]I've had my tutor look at it, and she can't work it out either, but I do get the feeling that she's not much wiser on Flash than I am.
View 17 RepliesI must admit I have struggled with this thing for a bit. It seems simple but for whatever reason I can't get it to work. I just want to make something move in AS 3 right now, and so far I've tried puzzling together two different tutorials, but both of them are missing either some source files or further explanation.
Anyway, here is the code (The bit I am having problems with)
Code:
//event listener checks for key presses
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkkey);
//Create keyHandler function
[Code].....
The problem is the checkkey function in the update function. If I leave the parenthesis empty it tells me it needs an argument, if I leave it like that it tells me I need a right paren before colon.
i'm very new to Flash and AS3. I've created a clip and need to link some buttons to some pages on my site but they don't seem to work. Please let me know if nyone can help me...below is my code:
[Code]...
I'm having trouble getting a game to go to the end scene after a collison with a barrier.
Code:
function dead() {
clearInterval(ants); //stop spawning
[code].....
I can't seem to get the hitTest to work for my script shown below. I have tested using movieclips created on stage during design time and made to collide during run-time. hitTest works fine in this situation.
But if I use the attachmovie command and create a movie on stage during run-time, that clip cannot hitTest with other movieclips. The hitTest simply doesn't work.
The script below is basically, to create instances of enemymc, and it will fall vertically, hitting a movieclip target_mc which is placed during design-time.
var enemyTime:Number = 0;
var enemyLimit:Number = 20;
onEnterFrame = function()
{
[Code].....
Why is the function not working?This is my function:
function add_controll_pannel() {
this.attachMovie("controll_pannel","controll_panne lMC",10);
controll_pannelMC._x="157";
controll_pannelMC._y="186";
}
And this is my function call:
add_controll_pannel;
Nothing happens.
The code that is commented out will work, however, I'm trying to turn that code, since it's used multiple times, into a function.
Why isn't my function working when it's being called?
ActionScript Code:
function displayInfo(_ROLL:MovieClip,_MC:MovieClip, _NN:MovieClip) {
_ROLL.onRollOver = function() {
[Code]......
Code:
var abc:Number = 0
btn.visible = true
btn.buttonMode = true
btn.useHandCursor = true
btn.addEventListener("click", buildIron())
[Code] .....
I tried this code but it didn't remove the event listener.
I'm not getting errors but my program wont call my function.
Code:
this.onEnterFrame = function() {
if(wm == 10)[code].....
I want to change to my end game screen when my value of variable wm gets to 10. Sorry I cant figure out whats wrong with the if statement. It doesnt work outside a function either.
Ive got a problem with comparing the currentframe with the totalframes of a loaded movieclip.this is my code
Code: Select allpublic function adLoaded(evt:Event):void
{
ldr = new Loader();
[code].....
I'm trying to write a function that I can use for creating text fields - in this case: to make the labels for a navigation menu. But the function is not working and I don't know what's the problem. Vars are: n = name and l = depth.
[Code]....
I'm not getting any takers over in the Flash 8 forum.I am using the snow method wonderfully created here on Kirupa and have a quick question. Currently, the movie just starts with a screen full of snow. I'd like to get it to start off screen and fall in. Basically setting an initial state for the ._y of 0. I also can't seem to get a delay working for the function.[code]
View 4 RepliesI just created an image gallery that displays 3 images at a time. For some reason, it works (for the most part) in Opera, but it doesn't display the images properly in IE.
img1, img2,and img3 are blank movie clips that hold each of the photos. The links to the photos are retrieved from XML, and are displayed in a random order. The first picture shows how it looks in IE, and the 2nd is in Opera. It also seems that the clearInterval() function isn't working like it should. Once the pictures are loaded, they are resized using the resizeMe() function (called by setInterval) to fit in the rectangle.
IE: Opera:
Code:
img1._alpha = 0;
img2._alpha = 0;[code].....
Ok, I have a function that creates a button, it takes the paramaters
bX, bY, bcColor, bbColor, bHeight, bWidth, bHandle;
here is my function
Code:
function createButton(bX:Number, bY:Number, bcColor:Number, bbColor:Number, bHeight:Number, bWidth:Number, bHandle:MovieClip)
{
[Code]....
some reason when I try to hide Handle, it doesn't do it, & trace's dont do anything either it is suppost to create the button & store it in any handle I give it
Ok, the code below does get called when the mouse moves, but its like it doesnt re-run the tween until the the mouse stops moving. how to fix it? click on portfolio and select web or interactive from the drop down and you will see what I mean.
PHP Code:
mouseListener = new Object();mouseListener.onMouseMove = function() (mc_mask.hitTest(_root._xmouse, _root._ymouse, false)) mousePosX = (_root._
xmouse-mc_mask._x); mousePosY = (_root._ymouse-
[code]......
i have the following 2 functions.[code]when i called the first function it works... peopleOffBus(); but then when i call the other function to make p visible true, the function peopleOnBus(); doesn't work.it is calling the function but somehow my array is not working or something.
View 1 RepliesI'm just wondering it is that that .removeMovieClip() isn't working for me. I'm using the correct path to the object, and I've used this function many many times before. But it's not removing it now this time. I heard that there was some sort of bug in flash that you had to swap depths or something? Flash CS3
View 2 RepliesIn actions in my .fla file I create a new object of a class (addChild) which is in an separate .as file. Now, in my .as file I want to call a function in the .fla file. This should be the parent right? So, I try parent.correct(); which does not work. I get the error #1061 (call to a possibly undefined method). However, when I do this:
var par:* = parent;
par.correct();
Everything works. Why is this?
I've been trying to get a flash map to zoom in and out but I can't seem to get it working, it'll zoom in fine, but not zoom out I'm zooming into a particular area of a map (Uganda in this example) with a function for a button, I'm using a boolean value to check if I am zoomed in and it registers whether it's true or false (checking with a dynamic textbox). [code]
View 8 RepliesI made a simple MOVIE which is hidden by default and will play only once the PORTFOLIO button is pressed.
PHP Code:
btn_portfolio.onRelease = function() {
subnavigation.gotoAndPlay("show");
};
I have checked and rechecked my MOVIE INSTANCE and still it's not working. I even tried adding "_root" and "this" before the "subnavigation" but still not working.
i have a movieclip on the main timeline, and inside that mc I have 1 button on first frame and 1 button of second frame...From the main timeline i run this script for frame 1 button...
publisering2.avpubliser_btn.onRelease = function(){
publisering2.gotoAndStop(2);
}
And this works fine.. however, i run the exact same script for the button on frame 2, ofcourse changing the path and gotoAndStop(1) instead... And this isnt working.. The button's over frame works so its activated...
I recently formatted my disk and installed WindowsVista Ultimate. Now, I find that this simple piece of code is not working. But earlier when I was using Windows XP, this code would open a new browser window (in firefox) and automatically prompt me to log into Gmail account, and after I log into gmail I will have this 'userEmail' successfully inserted in the "To:" field (inside gmail)
Code:
var userEmail="myemail@gmail.com"
getURL("mailto:"+userEmail);
Can't figure out why this is not working in my new OS.
I am working in CS4, but using as2 as the publish setting since the swf I need to load in was previously done in as2.I have an interface that I am loading a logo.swf into. This logo has animation that works properly both in test and in the browser. There is, however, a function in the logo.swf that is not working.
this.onRelease = function() {
getURL("http://www.yourdomainhere.com");
}
When I test with the IDE this is clickable within the interface, but when I view via the webpage it is not. AllowScriptAccess was set to sameDomain, but I have also tried that set to always.
am creating a little program with three sprites that rotate as you click on them.url...Right now the code is very long, so I am trying to use functions to make things more modularized.[code]"givenSprite.scaleX" gets "resizeFactor" added to it 90 times, as I intended. But "spriteDegrees" only increments once, instead of 90 times.Now here is the weird part, if I add "maDegrees --;" above "spriteDegrees --;" it works just fine. Can someone tell me why "spriteDegrees" is only incrementing once?
View 2 RepliesI do not uderstand why the stop on the attached file does not work. If I change the profile to AS 2.0. it works but not using in AS 3.0. See attached file.
Attachments: Stoptest.zip (6.7 K)
I have a funtion set up in my actionscript and I have the function start at frame 5 by doing:
functionName();
I'm trying to get the function to stop once it gets to frame 20. I was thinking something like functionName(stop); but that did not work.
how to make the function stop working?
function HomeButton(gosh){ if (gosh == "Intro") {trace(gosh);}else {trace("you are here");
attachMovie("buttonblank", "butt_blank", 2, {_x: 0, _y: 0});butt_blank._alpha = 100;butt_blank.onRelease = function() { gotoAndStop(2);}attachMovie("buttonblanktwo", "butt_blanktwo", 2, {_x: 613, _y:
[Code].....
I am designing a game in which there are three doors on stage. The doors are each instances of the same symbol. The instances are named "door1","door2" and "door3". The symbol contains three frames-"color1","color2" and "color3"- each frame is a the same door in a different color.
I want the game to randomly select a color for each door at the start of the game. I have been trying to use variations of the following code:
var min = 1;
var max = 3;
function doorColor (event:ENTER_FRAME, getNewDoor)
[Code].....
Why is the ENTER_FRAME tagnot working correctly?