Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Invisible Object Is Briefly Appearing OnEnterFrame..


Anyone have any ideas here?

I have an object on my stage that I am trying to remove at run time. Regardless of what method I use to hide/remove it, it always flashes onscreen for a brief second when loading the page. When I preview it, it is fine, but when this file gets loaded into the larger project, it shows. (Momentarily)

I know this is a problem I have seen people have before, and normally I would just fix it in the file, but I can't do that here. There are hundreds of files created from this template already that would take weeks to go back and change. The files all reference an external .as though, so I was hoping I could fix it in there...

I have tried swapping its depth, deleting it, hiding it...nothing works. I'm sure due to the fact that the code gets referenced on the same frame the object is in.

Can anything be done, or am I up that creek without the crucial paddle...




ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 12-01-2006, 07:11 PM


View Complete Forum Thread with Replies

Sponsored Links:

Briefly Warp Object Via Script
Last edited by sandman9 : 2003-11-22 at 13:51.
























I'm working on something which seems to be a bit out of my league.

I have a rectangular MC on stage with the following script on it





onClipEvent(load){
tx=250;
k=.2;
damp=.9;
}
onClipEvent(enterFrame){
// ax is a fraction of the distance from tx to _x
ax=(tx-_x)*k;
vx+=ax;
vx*=damp;
_x+=vx;
}

What I want to do is have this rectangle change shape or stretch or anything along those lines (for a brief second) when it reaches it's destination (aka 250) and then go back to it's original shape before the above code flings it back the opposite direction.

Hope this isn't too confusing ..... i've been thinking and thinking of ways to experiment with this and have had no luck thus far

PS-I try'd some "if" statements but I don't think that is the way to go about doing this

Sandman9

View Replies !    View Related
Help With Mouse Roll Over And Object Appearing
i don't know how to make it so that when you roll your mouse over a certain object you can make another object appear. please respond.

View Replies !    View Related
Object Appearing Every Couple Of Seconds
how do i get an object to appear on the screen every 10 seconds??


thx

View Replies !    View Related
MovieClip-derived Object Not Appearing?
Ach. I have a class that extends MovieClip called AxonClip, and a class that extends AxonClip called Target. I create several new Target objects like so:


Code:
Targets[i] = new Target("Targ"+i);

Targets[i].attachMovie("TargetArt", "TarGuy"+i, iDepth);
Later I update the position of that Target by changing its _x property. This *seems* to happen, as I can then trace(_x) and see that physics things are changing it. However, the clip never *appears* no matter what I do. I suspect this is because my Target class is not actually inheriting all the properties and methods that MovieClip has. If this is the case, is there something I can put in my class declaration, constructor or elsewhere to make sure these things inherit from MovieClip?

Also, is the AttachMovie even necessary, is there a better way to do it like linking a clip from the library to the particular class?

View Replies !    View Related
MovieClip-derived Object Not Appearing?
Ach. I have a class that extends MovieClip called AxonClip, and a class that extends AxonClip called Target. I create several new Target objects like so:


Code:
Targets[i] = new Target("Targ"+i);

Targets[i].attachMovie("TargetArt", "TarGuy"+i, iDepth);
Later I update the position of that Target by changing its _x property. This *seems* to happen, as I can then trace(_x) and see that physics things are changing it. However, the clip never *appears* no matter what I do. I suspect this is because my Target class is not actually inheriting all the properties and methods that MovieClip has. If this is the case, is there something I can put in my class declaration, constructor or elsewhere to make sure these things inherit from MovieClip?

Also, is the AttachMovie even necessary, is there a better way to do it like linking a clip from the library to the particular class?

View Replies !    View Related
Strange Trails Appearing When Object Tweens
Help, I've just made a new movie in Flash MX, and it plays fine in Flash MX, but when I test the movie, my stick figure, whenever he moves, he leaves a small trail of lines where he was. These lines dissapear after he moves near them, but they make the movie look like trash. This only happenes with the stick figure man, not with any other tweened object.
Anybody seen anything like this?
Know how to stop it?
Just getting annoying when my stick figure moves and it lookes as though half of him is still there split up in many small lines like this || ||||

View Replies !    View Related
MovieClip Object Not Appearing On Stage After Passing It To AddChild()
Short explanation of my question:

addChild appears 1 time in the code i posted. I essentially pass something to addChild.

Yet i cannot pinpoint where in the code the cause arises of why nothing seems to be added to the stage.

Here's a version of the code which is more comprehensively formatted than the code pasted below: http://flash.pastebin.com/m471d31c1





More detailed explanation:

Here's basically what i'm trying to do. The following code which you'll see are two AS3 classes in seperate flash .as files. Those classes are part of a game which i'm trying to create. The first class is called GameLogic and the second class is called Symbol. The class GameLogic is run as a script in a frame by creating a new object of that class in that framescript.



Ok so the code tries to generate random numbers from 0 to 8. Those random numbers represent types of symbols. When a random number is created and that number is not the same as a previously generated number, then it's used as an argument to create a new instance of the class Symbol.

Every new instance of the class Symbol is stored in an array. That array is called chosenSymbol[].



The class Symbol also contains a method getSymbolType(), which returns a MovieClip. So when i want to get a MovieClip which is basically a graphic design of a symbol i do this: chosenSymbol[].getSymbolType()

The MovieClips are in the library of flash and i have named them appropriatly(i think) and have checked the checkbox "export for actionscript" in their properties.



So to draw a MovieClip from the library to the stage i do: addChild(chosenSymbol[limitedCounter].getSymbolType());



Then when i try to test the movie in Flash i get no errors in the output window. But no MovieClip on the stage!

So i've tried to trace the height and width and name of chosenSymbol[limitedCounter].getSymbolType(), afterall it returns a MovieClip, When i do that i get 0 & 0 for height and width and some name called instance50 as the name. So there's definitly something wrong, but i can't seem to figure out what it is. The MovieClips are 92 * 92 pixels and they have names like Square_MC and Ring_MC etc.

I've also tried to give the MovieClip's X and Y values 200 and 200 to make sure they are positioned on the stage, but to no avail.



Can someone see what is wrong in this code? Why doesn't a MovieClip get shown on the stage?









This is the first class called GameLogic:




Code:

package

{ import flash.display.MovieClip; import flash.events.MouseEvent;



public class GameLogic extends MovieClip

{

public function GameLogic(chooseLevel:Number) {

var level:Level = new Level(chooseLevel); //Create new level object with mandatory level number argument



var chosenSymbolNumberArray:Array = new Array; //Create and array to store all the chosen symbol numbers in.

//Symbol numbers match certain symbol types like a square, ring, leaf, etc.

var chosenSlotNumberArray:Array = new Array; //Create an array to store the chosen slots in which are to be filled with the chosen symbols.



var slotArray:Array = new Array();

slotArray[0] = new Slot(0, false);

slotArray[1] = new Slot(1, false);

slotArray[2] = new Slot(2, false);

slotArray[3] = new Slot(3, false);

slotArray[4] = new Slot(4, false);

slotArray[5] = new Slot(5, false);

slotArray[6] = new Slot(6, false);

slotArray[7] = new Slot(7, false);

slotArray[8] = new Slot(8, false);



var chosenSymbol:Array = new Array();



//Set random chosen slots to "true" so that they are receptive for chosen symbols

for(var counter_0001:Number=0; counter_0001 < level.getAmountOfSymbols(); counter_0001++)

{

//Choose symbol (randomly)

chosenSymbolNumberArray[counter_0001] = Math.floor(Math.random()*9);



//Check if symbol number already exists in chosenSymbolNumberArray

for(var i_0001:Number=0; i_0001<counter_0001; i_0001++)

{

if((counter_0001 > 0) && (chosenSymbolNumberArray[counter_0001] == chosenSymbolNumberArray[i_0001]))

{

chosenSymbolNumberArray[counter_0001] = Math.floor(Math.random()*9);

i_0001 = -1;

}

}



//Create a new symbol in an array using the chosenSymbolNumberArray for the symbolType argument and _symbolType property

chosenSymbol[counter_0001] = new Symbol(chosenSymbolNumberArray[counter_0001], 300, 200);

var currentChosenSymbol:Number = chosenSymbol[counter_0001];

trace("chosenSymbol[counter_0001].getSymbolType()", chosenSymbol[counter_0001].getSymbolType());

trace("height", chosenSymbol[counter_0001].height, "width", chosenSymbol[counter_0001].width, "name", chosenSymbol[counter_0001].name);



//Choose slot (randomly)

chosenSlotNumberArray[counter_0001] = Math.floor(Math.random()*9);



//Check if slot number already exists in chosenSymbolNumberArray

for(var i_0002:Number=0; i_0002<counter_0001; i_0002++)

{

trace("passed", i_0002, chosenSlotNumberArray[counter_0001], chosenSlotNumberArray[i_0002]);

if((chosenSlotNumberArray[counter_0001] == chosenSlotNumberArray[i_0002]))

{

chosenSlotNumberArray[counter_0001] = Math.floor(Math.random()*9);

trace("regenerate", chosenSlotNumberArray[counter_0001], chosenSlotNumberArray[i_0002]);

i_0002 = -1; //reset counter to -1, so that at the next increment it starts from 0 again.

}

}



//Put the current chosen slot number in a variable to be able to pass it lateron as an argument

var newChosenSlot:Number = chosenSlotNumberArray[counter_0001];



//There is an array of slots called slotArray which contains Slot objects which have their containsSymbol argument and property set to false.

//This line of code overwrites the slotArrays of the chosen slots with a Slot object which has it's containsSymbol argument and property set to true.

//These particular uniquely chosen slots will receive a uniquely chosen symbol

slotArray[newChosenSlot] = new Slot(newChosenSlot, true, currentChosenSymbol);



trace(chosenSlotNumberArray[counter_0001]);

}



for(var counter_0002:Number=0; counter_0002 <= 8; counter_0002++)

{

trace("chosenSymbolNumberArray", chosenSymbolNumberArray[counter_0002]);

}







var limitedCounter:Number = 0; //Use a different counter for the chosenSymbol[] array in the following loop,

//otherwise when counter_0003 would have been used,

//then it couldn't return properties or call methods for counter_0003 array indexes which were not defined beyond the chosenSymbol array index level.getAmountOfSymbols().

for(var counter_0003:Number=0; counter_0003 <= 8; counter_0003++)

{



trace(slotArray[counter_0003].getContainsSymbol());

if(slotArray[counter_0003].getContainsSymbol() == true)

{

trace("ping");

trace("slotArray:", counter_0003, "_symbolType =", chosenSymbol[limitedCounter].getSymbolType());

chosenSymbol[limitedCounter].x = slotArray[counter_0003].getXPos();

chosenSymbol[limitedCounter].y = slotArray[counter_0003].getYPos();

chosenSymbol[limitedCounter].height = 100;

chosenSymbol[limitedCounter].width = 100;

addChild(chosenSymbol[limitedCounter].getSymbolType());



trace("height", chosenSymbol[limitedCounter].height, "width", chosenSymbol[limitedCounter].width, "name", chosenSymbol[limitedCounter].name);





if(limitedCounter < level.getAmountOfSymbols())

{

limitedCounter++;

}

}



}





}

}

}

View Replies !    View Related
MovieClip Object Not Appearing On The Stage After Passing It To AddChild()
Here's basically what i'm trying to do. The following code which you'll see are two AS3 classes in seperate flash .as files. Those classes are part of a game which i'm trying to create. The first class is called GameLogic and the second class is called Symbol. The class GameLogic is run as a script in a frame by creating a new object of that class in that framescript.

Ok so the code tries to generate random numbers from 0 to 8. Those random numbers represent types of symbols. When a random number is created and that number is not the same as a previously generated number, then it's used as an argument to create a new instance of the class Symbol.
Every new instance of the class Symbol is stored in an array. That array is called chosenSymbol[].

The class Symbol also contains a method getSymbolType(), which returns a MovieClip. So when i want to get a MovieClip which is basically a graphic design of a symbol i do this: chosenSymbol[].getSymbolType()
The MovieClips are in the library of flash and i have named them appropriatly(i think) and have checked the checkbox "export for actionscript" in their properties.

So to draw a MovieClip from the library to the stage i do: addChild(chosenSymbol[limitedCounter].getSymbolType());

Then when i try to test the movie in Flash i get no errors in the output window. But no MovieClip on the stage!
So i've tried to trace the height and width and name of chosenSymbol[limitedCounter].getSymbolType(), afterall it returns a MovieClip, When i do that i get 0 & 0 for height and width and some name called instance50 as the name. So there's definitly something wrong, but i can't seem to figure out what it is. The MovieClips are 92 * 92 pixels and they have names like Square_MC and Ring_MC etc.
I've also tried to give the MovieClip's X and Y values 200 and 200 to make sure they are positioned on the stage, but to no avail.

Can someone see what is wrong in this code? Why doesn't a MovieClip get shown on the stage?

View Replies !    View Related
MovieClip Object Not Appearing On The Stage After Passing It To AddChild()
Short explanation of my question:
addChild appears 1 time in the code i posted. I essentially pass something to addChild.
Yet i cannot pinpoint where in the code the cause arises of why nothing seems to be added to the stage.
Here's a version of the code which is more comprehensively formatted than the code pasted below: http://flash.pastebin.com/m471d31c1


More detailed explanation:
Here's basically what i'm trying to do. The following code which you'll see are two AS3 classes in seperate flash .as files. Those classes are part of a game which i'm trying to create. The first class is called GameLogic and the second class is called Symbol. The class GameLogic is run as a script in a frame by creating a new object of that class in that framescript.

Ok so the code tries to generate random numbers from 0 to 8. Those random numbers represent types of symbols. When a random number is created and that number is not the same as a previously generated number, then it's used as an argument to create a new instance of the class Symbol.
Every new instance of the class Symbol is stored in an array. That array is called chosenSymbol[].

The class Symbol also contains a method getSymbolType(), which returns a MovieClip. So when i want to get a MovieClip which is basically a graphic design of a symbol i do this: chosenSymbol[].getSymbolType()
The MovieClips are in the library of flash and i have named them appropriatly(i think) and have checked the checkbox "export for actionscript" in their properties.

So to draw a MovieClip from the library to the stage i do: addChild(chosenSymbol[limitedCounter].getSymbolType());

Then when i try to test the movie in Flash i get no errors in the output window. But no MovieClip on the stage!
So i've tried to trace the height and width and name of chosenSymbol[limitedCounter].getSymbolType(), afterall it returns a MovieClip, When i do that i get 0 & 0 for height and width and some name called instance50 as the name. So there's definitly something wrong, but i can't seem to figure out what it is. The MovieClips are 92 * 92 pixels and they have names like Square_MC and Ring_MC etc.
I've also tried to give the MovieClip's X and Y values 200 and 200 to make sure they are positioned on the stage, but to no avail.

Can someone see what is wrong in this code? Why doesn't a MovieClip get shown on the stage?




This is the first class called GameLogic:


Code:
package
{ import flash.display.MovieClip; import flash.events.MouseEvent;

public class GameLogic extends MovieClip
{
public function GameLogic(chooseLevel:Number) {
var level:Level = new Level(chooseLevel); //Create new level object with mandatory level number argument

var chosenSymbolNumberArray:Array = new Array; //Create and array to store all the chosen symbol numbers in.
//Symbol numbers match certain symbol types like a square, ring, leaf, etc.
var chosenSlotNumberArray:Array = new Array; //Create an array to store the chosen slots in which are to be filled with the chosen symbols.

var slotArray:Array = new Array();
slotArray[0] = new Slot(0, false);
slotArray[1] = new Slot(1, false);
slotArray[2] = new Slot(2, false);
slotArray[3] = new Slot(3, false);
slotArray[4] = new Slot(4, false);
slotArray[5] = new Slot(5, false);
slotArray[6] = new Slot(6, false);
slotArray[7] = new Slot(7, false);
slotArray[8] = new Slot(8, false);

var chosenSymbol:Array = new Array();

//Set random chosen slots to "true" so that they are receptive for chosen symbols
for(var counter_0001:Number=0; counter_0001 < level.getAmountOfSymbols(); counter_0001++)
{
//Choose symbol (randomly)
chosenSymbolNumberArray[counter_0001] = Math.floor(Math.random()*9);

//Check if symbol number already exists in chosenSymbolNumberArray
for(var i_0001:Number=0; i_0001<counter_0001; i_0001++)
{
if((counter_0001 > 0) && (chosenSymbolNumberArray[counter_0001] == chosenSymbolNumberArray[i_0001]))
{
chosenSymbolNumberArray[counter_0001] = Math.floor(Math.random()*9);
i_0001 = -1;
}
}

//Create a new symbol in an array using the chosenSymbolNumberArray for the symbolType argument and _symbolType property
chosenSymbol[counter_0001] = new Symbol(chosenSymbolNumberArray[counter_0001], 300, 200);
var currentChosenSymbol:Number = chosenSymbol[counter_0001];
trace("chosenSymbol[counter_0001].getSymbolType()", chosenSymbol[counter_0001].getSymbolType());
trace("height", chosenSymbol[counter_0001].height, "width", chosenSymbol[counter_0001].width, "name", chosenSymbol[counter_0001].name);

//Choose slot (randomly)
chosenSlotNumberArray[counter_0001] = Math.floor(Math.random()*9);

//Check if slot number already exists in chosenSymbolNumberArray
for(var i_0002:Number=0; i_0002<counter_0001; i_0002++)
{
trace("passed", i_0002, chosenSlotNumberArray[counter_0001], chosenSlotNumberArray[i_0002]);
if((chosenSlotNumberArray[counter_0001] == chosenSlotNumberArray[i_0002]))
{
chosenSlotNumberArray[counter_0001] = Math.floor(Math.random()*9);
trace("regenerate", chosenSlotNumberArray[counter_0001], chosenSlotNumberArray[i_0002]);
i_0002 = -1; //reset counter to -1, so that at the next increment it starts from 0 again.
}
}

//Put the current chosen slot number in a variable to be able to pass it lateron as an argument
var newChosenSlot:Number = chosenSlotNumberArray[counter_0001];

//There is an array of slots called slotArray which contains Slot objects which have their containsSymbol argument and property set to false.
//This line of code overwrites the slotArrays of the chosen slots with a Slot object which has it's containsSymbol argument and property set to true.
//These particular uniquely chosen slots will receive a uniquely chosen symbol
slotArray[newChosenSlot] = new Slot(newChosenSlot, true, currentChosenSymbol);

trace(chosenSlotNumberArray[counter_0001]);
}

for(var counter_0002:Number=0; counter_0002 <= 8; counter_0002++)
{
trace("chosenSymbolNumberArray", chosenSymbolNumberArray[counter_0002]);
}



var limitedCounter:Number = 0; //Use a different counter for the chosenSymbol[] array in the following loop,
//otherwise when counter_0003 would have been used,
//then it couldn't return properties or call methods for counter_0003 array indexes which were not defined beyond the chosenSymbol array index level.getAmountOfSymbols().
for(var counter_0003:Number=0; counter_0003 <= 8; counter_0003++)
{

trace(slotArray[counter_0003].getContainsSymbol());
if(slotArray[counter_0003].getContainsSymbol() == true)
{
trace("ping");
trace("slotArray:", counter_0003, "_symbolType =", chosenSymbol[limitedCounter].getSymbolType());
chosenSymbol[limitedCounter].x = slotArray[counter_0003].getXPos();
chosenSymbol[limitedCounter].y = slotArray[counter_0003].getYPos();
chosenSymbol[limitedCounter].height = 100;
chosenSymbol[limitedCounter].width = 100;
addChild(chosenSymbol[limitedCounter].getSymbolType());

trace("height", chosenSymbol[limitedCounter].height, "width", chosenSymbol[limitedCounter].width, "name", chosenSymbol[limitedCounter].name);


if(limitedCounter < level.getAmountOfSymbols())
{
limitedCounter++;
}
}

}


}
}
}
Here is the code for the Symbol class:


Code:
package
{
import flash.display.MovieClip; import flash.events.MouseEvent;

public class Symbol extends MovieClip
{
//Properties
private var _symbolTypeNumber:Number; //Can be a number between 0 and 8, indicating whether the symbol is a square or circel or leaf etc.
private var _symbolType:MovieClip;
private var _startingSlot:Number;
private var _startingXPosition:Number;
private var _startingYPosition:Number;
private var _currentXPosition:Number;
private var _currentYPosition:Number;
private var _nextXPosition:Number;
private var _nextYPosition:Number;

public var ring:MovieClip;
public var triangle:MovieClip;
public var square:MovieClip;
public var diamond:MovieClip;
public var cross:MovieClip;
public var hectagon:MovieClip;
public var star:MovieClip;
public var leaf:MovieClip;
public var puzzle:MovieClip;




//Constructor method
public function Symbol(symbolTypeNumber:Number, startingXPosition:Number, startingYPosition:Number)

//Create objects which can be passed as an argument/parameter to addChild()
//new objects need to be defined in the constructor
ring = new Ring_MC();
triangle = new Triangle_MC();
square = new Square_MC();
diamond = new Diamond_MC();
cross = new Cross_MC();
hectagon = new Hectagon_MC();
star = new Star_MC();
leaf= new Leaf_MC();
puzzle = new Puzzle_MC();

//Symbol type definitions
var symbolLabel:Array = new Array();
symbolLabel[0] = ring;
symbolLabel[1] = triangle;
symbolLabel[2] = square;
symbolLabel[3] = diamond;
symbolLabel[4] = cross;
symbolLabel[5] = hectagon;
symbolLabel[6] = star;
symbolLabel[7] = leaf;
symbolLabel[8] = puzzle;

if(symbolTypeNumber == 0)
{
_symbolType = symbolLabel[0];
}
else if(symbolTypeNumber == 1)
{
_symbolType = symbolLabel[1];
}
else if(symbolTypeNumber == 2)
{
_symbolType = symbolLabel[2];
}
else if(symbolTypeNumber == 3)
{
_symbolType = symbolLabel[3];
}
else if(symbolTypeNumber == 4)
{
_symbolType = symbolLabel[4];
}
else if(symbolTypeNumber == 5)
{
_symbolType = symbolLabel[5];
}
else if(symbolTypeNumber == 6)
{
_symbolType = symbolLabel[6];
}
else if(symbolTypeNumber == 7)
{
_symbolType = symbolLabel[7];
}
else if(symbolTypeNumber == 8)
{
_symbolType = symbolLabel[8];
}
else
{
_symbolType = symbolLabel[7];
}

trace("_symbolType:", this.getSymbolType());
//setSymbolTypeNumber(symbolTypeNumber);
//setStartingSlot(startingSlot);
//setStartingXPosition(startingXPosition);
//setStartingYPosition(startingYPosition);

//trace("Symbol Type:", getSymbolType()," ","Starting slot:", getStartingSlot()," ","Start X-Pos:", getStartingXPosition(),"Start Y-Pos:", getStartingYPosition());
}

private function setSymbolTypeNumber(sst:Number):void
{
_symbolTypeNumber = sst;


}
public function getSymbolType():MovieClip //Can also be * if one doesn't know what the return type will be
{
var relevantValue:MovieClip = _symbolType;
return relevantValue;
}

private function setStartingSlot(sss:Number):void
{
_startingSlot = sss;
}
public function getStartingSlot():Number
{
var relevantValue:Number = _startingSlot;
return relevantValue;
}

private function setStartingXPosition(ssxp:Number):void
{
_startingXPosition = ssxp;
}
public function getStartingXPosition():Number
{
var relevantValue:Number = _startingXPosition;
return relevantValue;
}

private function setStartingYPosition(ssyp:Number):void
{
_startingYPosition = ssyp;
}
public function getStartingYPosition():Number
{
var relevantValue:Number = _startingYPosition;
return relevantValue;
}

private function setCurrentXPosition(scxp:Number):void
{
_currentXPosition = scxp;
}
public function getCurrentXPosition():Number
{
var relevantValue:Number = _currentXPosition;
return relevantValue;
}

private function setCurrentYPosition(scyp:Number):void
{
_currentYPosition = scyp;
}
public function getCurrentYPosition():Number
{
var relevantValue:Number = _currentYPosition;
return relevantValue;
}

private function setNextXPosition(snxp:Number):void
{
_nextXPosition = snxp;
}
public function getNextXPosition():Number
{
var relevantValue:Number = _nextXPosition;
return relevantValue;
}

private function setNextYPosition(snyp:Number):void
{
_nextYPosition = snyp;
}
public function getNextYPosition():Number
{
var relevantValue:Number = _nextYPosition;
return relevantValue;
}
}
}

View Replies !    View Related
Invisible Object
Greetings.

A quick silly question. How do i make an object (picture, movie clip, etc) "invisible" when loading a frame or clicking a button?
Can anyone give me a hand?

Thanks a lot

T

View Replies !    View Related
Make Object Invisible?
I have a "movieclip" on my timeline.
And within another "movieclip2" on the same timeline i have the script:

on(press) {
_root.movieclip._alpha = 0 ;
}

With the intent that you push one movieclip and it makes the other movieclip invsible.

But its not workking.
why?

View Replies !    View Related
Bizarre Text Briefly Appears...
Hi,
Could someone take a look at my online CV: Guy Moorhouse CV and check something out for me?
Basically, just after you click the CV button, watch the main box, as before the text loads in, momentarily some actionscript is visible...any ideas why this is happening or what it could be?

You'll need sharp eyes - it appears and disappears pretty darn quickly (it's more obvious on a dial-up connection, for obvious reasons)...

Cheers

View Replies !    View Related
Pause Scrolling Images Briefly
So I have a strip of images that I need to move across the screen and have the motion pause briefly on each image when it reaches the center of the stage. The images are contained within a mc called "images". I can make the images move continuously with


ActionScript Code:
images.onEnterFrame=function(){
    images._x+=10;

I guess it would be a script that says something like,

ActionScript Code:
if(images.img1._x=Stage._width/2){
//something that tells it to pause for 1 second and then move again???
}

I have no idea what to do to make it pause as each individual image hits the center of the stage and then after about 1 second moves on to the next picture.

Anyone?

View Replies !    View Related
Making A Droptarget Object Invisible Or Nearly So
I'm using this script to create a hittest drag and drop scene...

----
on (press) {
startDrag (this, true);
}
on (release) {
stopDrag ();
if (this.hitTest(_root.adams)) {
this._xscale = 10;
this._yscale = 10;
} else {
setProperty (this, _x, "365");
setProperty (this, _y, "78");
}
}
---
what I want to do is have the visibility of the drop target, in this case "adams", drop to 50% when the hitTest is true (when the thing I'm dragging is the correct item for the "adams" target) How can I do this within this script?

anything will help! Thanks!

View Replies !    View Related
Object Gets Invisible After Applying The Effect
i would like to know that as i put the effect to an object, and get back to the workspace, so it shows that effected object invisible
in the flash working space .

like if i add alhpa (0%) effect to an name " waqas " so it invisible the "waqas" object from the main window, mean to discribe that it shows the fisrt frame, would you please tell me that is there any
way to show the last frame that could help me to view the object in
origal condition while i'm working on the main work space .

thank you very much



Reply as soon as possible

View Replies !    View Related
Making An Object Temporarily Invisible
I have an embedded mpeg as my very bottom layer, what i want to do is have a section of a shape go behind an object in the mpeg when it moves so that the shape appears behind the movie object. How do i go about doing this?

Thanks!

View Replies !    View Related
Force An Object To Be Invisible In First Frame
i am trying to make a rectangle invisible in by using the code rectangle_mc._visible = false in the first frame.

the rectangle is still drawn in the first frame , but then quickly disappears once the _visible = false is processed.

how do I keep the rectangle from being drawn in the first frame?

View Replies !    View Related
Flash Background Briefly Showing As White Despite Bgcolor Tag
Here is one I've been stuck on for over a week - hope someone out there can help.

I created a 60kb Flash movie that is a dark blue background that matches the same color dark blue as used on my web site's background. My movie size is 700x300.

However when I first hit the page my web site navigation and headers/footers loads, but for a split second my 700x300 area is white! As soon as the Flash movie starts playing it goes to the dark blue background as set up in the Flash movie. When I run the movie within SWiSH of Flash MX it starts initially with the dark blue background just fine (no white is seen). Also after its loaded in the browser and I press reload I never see the white area again.

I checked my web pages BGCOLOR tag and it is set to the dark blue. I also checked my HTML that writes out the Flash movie code, and its passing in the same BGCOLOR tag both as a "param name" and as part of the embed tag.

For reference I am using broadband so the load on 60kb should be near instant. I'm using IE 6 on Windows. I don't understand why the browser would put up a white box when I've specified its a dark blue background to use in (apparently) all the right places.

An exaggerated example of this can be seen if I change the name of the movie file to a bad name on purpose and then reload the page. In this case the movie area shows as all white, even though I've specified a different bg color. Yes I can understand IE considers it a bad movie but even so it just shows that its not following my bgcolor since it should at least have the movie area in the specified bgcolor even if it can't load the movie.

Here is the html I am using:
<html>
<body bgcolor="#000066">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0"
id="test" width="700" height="300">
<param name="movie" value="mytest.swf">
<param name="bgcolor" value="#000066">
<param name="quality" value="high">
<param name="allowscriptaccess" value="samedomain">
<embed type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
width="700" height="300"
name="test" src="mytest.swf"
bgcolor="#000066" quality="high"
swLiveConnect="true" allowScriptAccess="samedomain"
></embed>
</body>
</html>

Does anyone see anything wrong with this? I must be doing something wrong, as I never see this type of background issue on anyone else's flash on the web... Any help is greatly appreciated!

View Replies !    View Related
Can OnEnterFrame Method Run Within An Object?
Hi,
I am trying to implement an onEnterFrame method within an object that is not applied to a MovieClip. The onEnterFrame is not running, most likely because it is not a movieClip. Is there a way of making it run without attaching anything to the stage?

View Replies !    View Related
Can OnEnterFrame Method Run Within An Object?
Hi,
I am trying to implement an onEnterFrame method within an object that is not applied to a MovieClip. The onEnterFrame is not running, most likely because it is not a movieClip. Is there a way of making it run without attaching anything to the stage?

View Replies !    View Related
How To Associate A OnEnterFrame Event To An Object ?
I have a custom object and I want that it react to onEnterFrame event.

example:


Code:
FMyObject = function (mc)
{
this.mc = mc;
}

FMyObject.prototype.onEnterFrame = function ()
{
this.mc._x += 5;
}


of course, this is not working.


Is possible to simulate this without associating the onEnterFrame event to a movieclip ?

View Replies !    View Related
OnEnterFrame Vs OnMouseMove To Move Object
Okay lets say I want to move up and down on object.y with onMouseMove

should I use
ActionScript Code:
object.addEventListner(MouseEvent.MOUSE_MOVE, onMove);

function onMove(e:MouseEvent)
{
 object.addEventListener(Event.ENTER_FRAME, onFrame);
{

function onFrame (e:Event)
{
  object.y +=  // some code
}

Or would this be better to move the object?
AS]
object.addEventListner(MouseEvent.MOUSE_MOVE, onMove);

function onMove(e:MouseEvent)
{
object.y += // some code
}

[/as]

Thanks

View Replies !    View Related
OnEnterFrame Change Color Of Object
A colored ball sits on the stage, it's _x and _y changes as you advance in frame 1 and 2, on frame 3 there is a reset button that takes you back to frame 1 and the _x position is reset using _x. math random ()*300. Anyway of also setting hue using the color matrix filter (or change color filter or anything ???) to a random value between -180 and 180?- Just want to change the color every time you reset. Thanks

View Replies !    View Related
Color Object Prototype And This.onEnterFrame
Can you use the "this.onEnterFrame = function()" function within a Color.prototype function? I'm trying to write my own function to go from one color to another, but nothing works within my this.onEnterFrame function, but anywhere outside of it it works fine.

I've done this before, but using a movieclip prototype, so I know it's not syntax. And if you can't, for some reason, use this.onEnterFrame within a color prototype, how do you pass the name of a color object to a function so that I could just say changeColor(myColor, 0xffffff); to change it to white?

Thanks.

View Replies !    View Related
Color Object Prototype And This.onEnterFrame
Can you use the "this.onEnterFrame = function()" function within a Color.prototype function? I'm trying to write my own function to go from one color to another, but nothing works within my this.onEnterFrame function, but anywhere outside of it it works fine.

I've done this before, but using a movieclip prototype, so I know it's not syntax. And if you can't, for some reason, use this.onEnterFrame within a color prototype, how do you pass the name of a color object to a function so that I could just say changeColor(myColor, 0xffffff); to change it to white?

Thanks.

View Replies !    View Related
Object.onEnterFrame Only Runs 1 Time... Weird
weird problem guys, here is the jist of it:

function goLogo() {
for (var i=0; i<logos.childNodes.length; i++) {
curBut = attachMovie("inner_mc", "button_mc"+i, _root.getNextHighestDepth());
curBut.loadMovie(logos.childNodes[i].attributes["logo"]);
curBut._x = 100*i;
logowidth = 100*i;
buttonHandle(curBut);
}
}

function buttonHandle(object) {
object.onEnterFrame = function() {
trace("enter");
if(_xmouse < 390) {
xMath = (390 - _xmouse) / 10;
this._x += xMath;
}

if (_xmouse > 460) {
xMath = (460 - _xmouse) / 10;
this._x += xMath;
}

}
}



"enter" only traces 4 times, 1 time for each of the objects. Has this happened to any of you? Ive never had an onEnterFrame mess up before. I've attached the source file because I'm really stumped here.

View Replies !    View Related
Object.prototype OnEnterFrame Doesnt Work :(
i cant get the onEnterFrame to work with my object.

I have the following code:

_global.myFunction= function () {
};


myFunction.prototype = new MovieClip();


myFunction.prototype.onEnterFrame = function() {
trace("HELLO"); // this doesn't work
}

Anyone knows how come the nothing gets executed in onEnterFrame???

View Replies !    View Related
[MX]Dynamically Assigning An OnEnterFrame Event To A Clip Contained Within An Object
I have the following section of code in which I wanted to dynamically assign an “ onEnterFrame” event to a clip contained within an object which itself is contained within an array.

Basically the assignment doesn't work. You may notice the 2 “trace” commands set out in the code. The first correctly names the array elements object clip & the second returns “undefined.”

code:
for (var k = 0; k<_root.shell_array.length; ++k) {
trace(shell_array[k].clip);//gives correct reference
shell_array[k].clip.onEnterFrame = function() {
trace(shell_array[k].clip);//returns “undefined”
yAmount = shell_array[k].ymov += grav;
shell_array[k].x += shell_array[k].xmov;
shell_array[k].y += yAmount;
shell_array[k].clip._x = shell_array[k].x;
shell_array[k].clip._y = shell_array[k].y;
shell_array[k].curvingX_array.push(shell_array[k].x);
shell_array[k].curvingY_array.push(shell_array[k].y);
};
}



Anyone please tell me where I'm slipping up with this?

View Replies !    View Related
OnEnterFrame=null, OnEnterFrame=undefined & Delete OnEnterFrame....
onEnterFrame=null, onEnterFrame=undefined & delete onEnterFrame....


Which one to use??? What are the performance considerations. If all my movieclips on-stage are running a MovieClip.prototype.onEnterFrame = function() {run initial stuff before setting onEnterFrame=null/undefined... }, will there be performance hits? It's sad that delete onEnterFrame doesn't work unless I delete the prototype enterFrame as well, which would make the clips reinitailise itself again once you declare the enterFrame prototype again (i need to do this since there's more movieclips that end up appearing on-stage, and they need to automatically initialises themselves the moment they appear).

It seems that setting enterFrame to null or undefined is the safest way to go about it, since dealing with multiple .swfs would mean using the same MovieClip.prototype, which means I can't afford to flush out one zone of enterFrames (by deleting both null enterframes and MovieClip.prototype.onEnterFrame) if it means the other zones still needs to initialise their clips first...it's just too troublesome and buggy a mechanism to implement! Once MovieClip.prototype.onEnterframe is declared, it should stay. Will there be performance hits as a result of this?

Is there anyway to do this without tricking the engine to call the onLoad function for MCs by typing "//" into each movieclip actionscript box --- or by troublesomingly creating linkage-ids for every movieclip library item!? NO! That's not what i want...they'll only add to the fiile size! How do i execute a certain "constructor/initilisation" function to all Movieclips without linking them to a class in a library? Something to think about.....

View Replies !    View Related
Making Invisible Buttons Really Invisible...
here is what i want to do:

i want to place invisible buttons across my .fla that trigger random actions in other movie clips. however, i do not want the user to know that they are triggering these invisible buttons - how do i do this?

when you roll over a button, whether visible or invisible, the cursor changes from an arrow to a hand - how do i prevent this from happening (meaning, how do i keep it as the arrow instead of changing to a hand on roll over/roll out)?

thanks

alex

View Replies !    View Related
What Difference Between Mc.onEnterFrame And Funtion OnEnterFrame()
Dear, All,
Could anybody tell me the difference about them, I am fresh......

thanks in advance

View Replies !    View Related
Problem With OnEnterFrame And Delete OnEnterFrame
Ok here is the nuts of the problem,

When I delete the onEnterFrame function programatically I can't reassign it later.

Here is what is happening:
I have a method that I call to build a box on the screen over time. I build it overtime using the onEnterFrame function.
When the application is done it delete the onEnterFrame just fine.

Everything works as expected until you try to assign the same method over again to say for instance make the box smaller. Once I try to call it again I can't assign the onEnterFrame again... I have no idea why it is totally strange.


Code:
//Create an interface
//mc:MovieClip, x:Number, y:Number, w:Number, h:Number
InterfaceBuilderClass.prototype.createInterface = function(mc,x,y,w,h)
{

mc.dy = (h/2)*-1
mc.dx = (w/2)*-1
mc.dy1 = h/2
mc.dx1 = w/2
mc.NFRAMES = 40;
mc.controller = this;
mc.t = 0;

mc.onEnterFrame = function()
{
if (this.t++ < this.NFRAMES) {
trace(this.t);
//DELETED DRAWING STUFF THAT IS NOT AFFECTING THE PROBLEM

}else
{
//redraw with rounded corner
//DELETED DRAWING STUFF THAT IS NOT AFFECTING THE PROBLEM

this.controller.executeCallBack()
delete this.onEnterFrame;
}
}
}

Try it for yourself and see if you can make it work.

If anyone else has run into this problem I'd love to know how you resolved it.

Thanks,
Mark

View Replies !    View Related
Re-initialising OnEnterFrame After Deleting OnEnterFrame
Hello to all the actionscript guru's!

I have this thing where when I click this other thing which is controlled by a different thing which gets deleted after I click the other thing and I would like to know if I can sort of undelete the different things thing????

Okay, now in English.

I have some movieclips that move using an onEnterFrame. When you click on a movieclip, I stop the movement by deleting the onEnterFrame. Is there a way to re-initialise the onEnterFrame to get the movieclips moving again?

A thanks in advance for everyone who reads this question

View Replies !    View Related
Delete OnEnterFrame; Start OnEnterFrame?
Hi, title says it all.... any consise methods to restart a deleted onEnterFrame that has been deleted?

Thanks!

View Replies !    View Related
Delete OnEnterFrame Re-establish OnEnterFrame
i'm trying to stop an onEnterFrame [via the delete onEnterFrame] but later re-establish it, or restart it. is this even possible?? anyone got suggestions if it ain't??

View Replies !    View Related
Visible .... Invisible... Invisible
i am going insane!!!!
here is my structure:

In MAIN.swf, scene 1, i have a ANIMATION (called buttons)
with a collection of buttons... in one of the BUTTONS I have (which works fine):

on (release) {
setProperty ("/buttons", _visible, "0");
}

---> sample1.swf (level 43)

on (release) {
setProperty ("_level0.scene1.buttons", _visible, "1");
}


does anyone have any clues why this is not working?!!
NOTE: i have tried making the
1) 1 to true,
2) setProperty ("_level0.scene1.buttons", _visible, 1)
3) _level0.scene1.buttons._visible = 1;

any other suggestion?

View Replies !    View Related
[F8] OnEnterFrame Inside OnEnterFrame
this is a simplification of what I have:

function fadeOutBorder(thumbnail){
this.onEnterFrame = function() {
if(this["thumbnail"+thumbnail]._alpha>0) {
this["thumbnail"+thumbnail]._alpha-=5;
}else{
this["thumbnail"+thumbnail]._visible=false;
//delete _root.onEnterFrame;
}
};
}


function loadThumbnails(){
onEnterFrame{
//stuff here...
fadeOutBorder(5);
//when that^^ is called... it quits the rest of the script...
//more stuff here...
};
}


So what happens is when I call fadeOutBorder.. It just stops that onEnterFrame in the loadThumbnails function.

View Replies !    View Related
Swf Appearing Under Other Swf
Hi all

I have an annoying problem: I have an expanding banner ad that when expanded appears underneathe the other embedded swf's on the page. Is this a known problem? I've tried a million ways to play with the z-index, but nothing works - any tips or suggestions?

thanks

View Replies !    View Related
MC's Not Appearing
Ok guys im stumped..I have a ton of MC's on my site and I use TWEENING AS to animate them in. For some reason some of them don't appear when you first load the site. However if you hit refresh they show up? Has this happened to anyone before? Thanks everyone

Heres the link to my site im working on:

http://www.25-questions.com/testing/


You can see that when you load its missing a movie clip that has "jewish mother" in it. But when you refresh the page it shows up..so frustrating

-R

View Replies !    View Related
Appearing Image
HI, here is my stupid question

I just want an image to appear smoothly
first image: alpha is zero
last image: alpha is 100%

How to make the animation between those two?

View Replies !    View Related
Please Help HTML % Not Appearing
I'm importing a html formatted text file into my a text box in my flash MX movie.

All the text apart from the % character's appear.

Text is:

textBox=<FONT FACE="Verdana" SIZE="14" COLOR="#000000">%%55</FONT>

Any ideas?

Cheers
J

View Replies !    View Related
Appearing And Disappearing Help
Yes I would like to know the steps in making things appear and disappear slowly I know you use Alpha to do taht but not exactly sure how to do it. If you could be specific as in keyframe/frame.. That would be greatly appreciated thks

View Replies !    View Related
Appearing Text
Hi, i got a problem. I want to do an appearing text, like someone types it right now. Ok, that's easy, you make a new picture for every letter. But the text is very long, and i dont want to write every letter its one. So, can someone write me an actionsprict, or something like this??????????? PLEASE!!!!!!!!!
thx Tauron

View Replies !    View Related
Appearing Text
Hi, i got a problem. I want to do an appearing text, like someone types it right now. Ok, that's easy, you make a new picture for every letter. But the text is very long, and i dont want to write every letter its one. So, can someone write me an actionsprict, or something like this??????????? PLEASE!!!!!!!!!
thx Tauron

View Replies !    View Related
Button Not Appearing
HI, i have made a movie clip, which is the up state for a button, i made another mc which is the over state for the same button. when i drag them onto the stage everything is good, it all appears as it should. but when i test the movie parts of the button are missing???
does anyone know why this happens, what do i need to do to fix this???
thanks for your help (again)

View Replies !    View Related
Fonts Not Appearing
Hello,
Despite the fact that my fonts are in the font sdytem folder on my MAC (OS 9.1) the missing fonts dialogua appears and when I view the font selection from within flash, there are many fonts that are not being displayed. Why is this and how can I make sure that FLASH recognizes all the fonts on my system?

Thanks
Uri

View Replies !    View Related
Text Not Appearing
I posted this in fonts originally, but havent seen a response-

does anyone know why text doesnt appear inside an array?
I have a main movie that loads separate movies - each separate movie contains an array. When I test all of these together in the main movie, the text disappears. I could put the FLA's up, but if anyone knows a quick answer to this, it would be great.

Im using flash MX

thanks!

check out http://www.quintessence-media.com/qu...ence/main.html to see it in action-

http://www.quintessence-media.com/q...sence/main.html

View Replies !    View Related
Text Not Appearing
Hello,
I have some text converted to a graphic which sits on top of another image which is also converted to a graphic symbol.
When i view the animation in the timeline the text appears but when i publish it the text does not appear. Anyone know why this is?
thanks

View Replies !    View Related
A Web Browser Appearing In An Mc
a web browser appearing in an mc? is this possible to do because i'm having tough luck.

View Replies !    View Related
Appearing And Dissapearing Box
Hello. im trying to make an options popup box

I have a window/box movieclip in my flash movie which i want to appear on the stage at x50 y50 upon clicking a button.

There will be another button which is a part of th window/box movieclip which when clicked will remove the window/box movieclip from the stage.

If anyone can help mw tieh some script for the button to make this happen i'd be very greatfull.

View Replies !    View Related
Text Not Appearing
I'm new to flash and am trying to display game data ingame. I created a text box to show the category(ie lives, etc.) and then a dynamic text box next to it that i left blank. In its properties, I put in a variable name and in a movie clip, I defined the variable and put in actionscript to update it constantly. For some reason, it does not show. I'm using Flash MX 2004 professional. thanks in advance

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved