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




Adding All Instances In A Scene To An Array



I want to instruct actionScript to look at my scene, go though each item on it (e.g. all of the check boxes and radio buttons) and add each of these items that have got an instance name into an array.

I can't think of a simple solution to this. Can anyone help please?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-14-2006, 03:21 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Adding All Instances In A Scene To An Array
I want to instruct actionScript to look at my scene, go though each item on it (e.g. all of the check boxes and radio buttons) and add each of these items that have got an instance name into an array.

I can't think of a simple solution to this. Can anyone help please?

Help With Adding Variables/instances
Alright, on my website www.fatbug.com I have an order form, the user can pick between how many labels they want, and what type of shipping using a combo box. What im trying to do is have a dynamic text box display the total purchase i.e. $575 for 5000 labels and 25 for priority shipping.

Here is the .fla and i hope to hear back!

http://www.yousendit.com/transfer.ph...774319571CB7C7

Help With Adding Variables/instances
Alright, on my website http://www.fatbug.com I have an order form, the user can pick between how many labels they want, and what type of shipping using a combo box. What im trying to do is have a dynamic text box display the total purchase i.e. $575 for 5000 labels and 25 for priority shipping.

Here is the .fla and i hope to hear back!

http://www.yousendit.com/transfer.php?action=download&ufid=93774319571CB7C7

Adding Multiple Instances Of The Same Movieclip
Hi! I have a bunch of buttons that are in an array, and when you click on a button, a specific movieclip is placed on the stage. I just realized that I can only add one instance of a movieclip. For example, if I click on the crayon button, an image of a crayon appears, but nothing happens if I click the button again. How do I allow for multiple instances of the same movieclip to be placed on the stage?

Here is the code I'm working with:

PHP Code:



var itemsByButtonCog:Dictionary = new Dictionary();
var itemArrayCog:Array = [//Cognitive
                       new mcMirror(), new mcBrain(),
                       new mcCalendar(), new mcClock(),
                       new mcBook(), new mcCalculator()];

var buttonsCog:Array = [//Cognitive
                    cogChar_mc.cogCharContent_mc.mirror_btn,
                    cogChar_mc.cogCharContent_mc.brain_btn,
                    cogChar_mc.cogCharContent_mc.calendar_btn,
                    cogChar_mc.cogCharContent_mc.clock_btn,
                    cogChar_mc.cogCharContent_mc.book_btn,
                    cogChar_mc.cogCharContent_mc.calculator_btn];


for(var j:int = 0; j < buttonsCog.length; j++){
    buttonsCog[j].index = j;
    buttonsCog[j].buttonMode = true;
    itemsByButtonCog[buttonsCog[j]] = itemArrayCog[j];
    buttonsCog[j].addEventListener(MouseEvent.CLICK, itemMoveCog);
}    

function itemMoveCog (event:MouseEvent):void {
        var itemCog:Sprite = itemsByButtonCog[event.currentTarget];
        itemCog.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
        itemCog.addEventListener(MouseEvent.MOUSE_UP, dropIt);
        MovieClip(root).mainStage_mc.addChild(itemCog);
}




Thanks in advance for any help!

Adding Multiple Instances To One Function
Hey there,

I'm having trouble adding multiple instances to one function, however theres one small difference in each function, is there a way around having to repeat the setInterval function button everytime?

Thank you in advance

below is the code i'm working with and there ten buttons;


Code:
answerOne.onRelease = function(){
var P = _root.Patents_1;
_root.infoPanel.T.embedFonts = true;
_root.infoPanel.T.text = nn;
_root.infoPanel._visible = true;
var x:Number;
obj = new Object();
obj.interval = function() {
_root.infoPanel._visible = false;
clearInterval(x);
}
x = setInterval( obj, "interval", 4000 );
};

answerTwo.onRelease = function(){
var P = _root.Patents_2;
_root.infoPanel.T.embedFonts = true;
_root.infoPanel.T.text = nn;
_root.infoPanel._visible = true;
var x:Number;
obj = new Object();
obj.interval = function() {
_root.infoPanel._visible = false;
clearInterval(x);
}
x = setInterval( obj, "interval", 4000 );
};

and so on.........................

Adding Action Script To Instances...
I'm pretty frustrated and am done searching the site. Awful...just awful. Anyway...

Using Flash CS3 for the first time since upgrading. I'm not able to add action script to instances. Certainly this isn't a change. I've created a button symbol. I've named the instance upon dragging it on the stage. Now it tells me I can't apply actions to it.

I hope I'm just missing a step.

Skip To End Of Scene With Multiple Instances?
I purchased a flash template online with a header slideshow animation that cycles through itself 5 times, replacing images, before ending with some text being added. When the slideshow ends, you can scroll through the images within the slideshow by moving the cursor to the left or right of the animation – the text stays and only the images change.

The whole cycle takes 30 seconds so it’s great on the first page but quickly becomes annoying after the 5th page you’ve viewed.

I would like to skip to the end of the show – where the text has been added and you can just move your cursor over the image to switch pictures – skipping all the animation of the various pictures loading.

Unfortunately, because its not a straight timeline, I have been having trouble with the GoToAndPlay() command. It is a single scene but if I chose the final frame, the animation freezes with the first image – apparently because the movie repeats on it self again and again.

I have contacted the template resource group but they either don’t want to admit they don’t know how to fix it or they don’t want to take the time – either way they have not been much help. It seems like a straightforward issue, but then again, if I knew what I was doing, I would have it fixed.

Is anyone out there familiar a GoToAndPlay() command that references not only a frame but a cycle or instance of the animation.

Does any of this make sense?

Adding Different Actionscript To Multiple Instances From The Same Symbol
well thats it, kind of. i have a movie, inside that movie is a button, and a layer with animation that is activated with script when the button is moused over, with the use of the call action. i have about 10 instances of the movie on my scene, however i dont know how to add different actions to one instance without it affecting them all. i'm a bit of a beginner to actionscript, so i dont know what to do. i could upload the file if it might help. well, if anyone understands what i am trying to do, and knows how to do it...let me know, i could really use the help.
thanks, Ben

Adding Many Flash Instances. Performance Issues?
I had a general question about adding many flash embeds on a page. I have a page with 12 transparent, non-animating swf files, ech showing a single static images and each roughly 20k in size. But my concern is that on slower machines this might be taxing on the CPU, cause memory issues, maybe page loading issues...?

Any thoughts on this or other concerns?

Adding Thousands Of Instances Of A Movie Clip
I am trying to add around 20,000 instances of a single small movie clip (HexTile) from the library into a container Sprite using actionscript. The problem is it loads immediately and it loads very slowly, so I would like to know if there is a way to preload it? The class that adds the movie clip library symbol (World) is not the document class, nor is it referenced from the document class. I have tried dragging an empty sprite linked to World, and I have tried exporting it to other frames as well is preloading it as it's own .swf...any suggestions would greatly appreciated! The code looks like:







Attach Code

public class World extends Sprite
{
private var map:Sprite;
function World()
{
map=new Sprite();
addChild(map);
placeTiles();
}
//Place hexagon tiles onto the map
private function placeTiles(map_width:uint=75,map_height:uint=75):void
{
var tempTile:HexTile;
for (var i:uint=0;i<map_height;i++)
{
for (var j:uint=0;j<map_width;j++)
{
tempTile=new HexTile();
map.addChild(tempTile);

}
}
}
}

Looping (or Adding Multiple Instances) Of MoveClips
Hey guys,
Im making a navigation and ive ran into a hang up, i want the content to repeat over and over when i scroll, but am not sure how to do it.

this is my setup:
I have a Swf that holds my controls (up/down). This swf loads another swf into a "holder" MC that acts as the content for the display.
The problem I am having is that i want for the content to loop over and over, so its seemless when you scroll. However, using the seup ih ave now, Im not sure how to acheive this. Any ideas or pointers guys?

Heres my code for the parent SWF


Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

uparrow.onRelease = up
downarrow.onRelease = down

onEnterFrame(loadMovie("newprojectsSLIDER.swf",holder));

var ypos:Number = holder._y;

function up (){

var ytween:Tween = new Tween(holder, "_y", Strong.easeOut, ypos, ypos+105, .8, true);
ypos+=105;
}
function down (){
var ytween:Tween = new Tween(holder, "_y", Strong.easeOut, ypos, ypos-105, .8, true);
ypos-=105;
}
newprojectsSlider.swf is the "content" then the buttons move the MC holding it up or down.

You can find the sample Here


Thanks a Million

Adding Multiple Instances Of A Movieclip To Stage
Hi there,

Still in the process of learning AS3 and was wondering how to attach multiple instances of a movieclip to the stage. In AS2 I would do the following:


Code:
for(var i = 1; i <= 10; i++){
attachMovie("myMovie", "myMovie" + i, i);
}
but I can't figure out how to do this with AS3.

Any ideas?

Bob

Selecting Movie Clip Instances On Main Scene
Is there an easy way to find and select movie clip instances on the main
scene? I'm working with a pre-built template and I'm trying to find and
edit a movie clip instance on the main scene, but I'm having trouble
selecting it.

Thanks.

Array Of Instances?
There is a way to create an array of instances???
I mean that I would like to know if I can do something like:

myInstance[1]
myInstance[2]
myInstance[3]
etc...

If it is possible, would be easier to handle group of instances of the same object...

Thanks!!!!

Put The Most Frequent Instances Of An Array Into A New One
Hi,

Anybody know an easy way?

ie. (1,5,6,7,8,7,5,6,5,7,) = (5,7)

Thanks, Steve.

Put The Most Frequent Instances Of An Array Into A New One
Hi,

Anybody know an easy way?

ie. (1,5,6,7,8,7,5,6,5,7,) = (5,7)

Thanks, Steve.

Array And Naming Instances
Hi,

I am trying to duplicate a newly created movie. BUT, the instance names are created with a for statement that gets data from an array (aScreen). The array contains path for file to be imported to the newly created movieclips.

I do not know how the syntax to put variables in instance names in dot syntax...

mcXXXX.["mcImage"+i].whatever(); was my last try.




Code:
for(var i:Number = 0; i < aScreen.length; i++) {

// new numbered movieclip (mcThumbs is a mc that contains thumbnails)

mcThumbs.createEmptyMovieClip("mcImage"+i, mcThumbs.getNextHighestDepth());

// movie clip loader

mclImages.loadClip(aScreen[i], "mcThumbs.mcImage"+i);

// Until here everything works... duplicateMovieClip doesnt work

mcThumbs.["mcImage"+i].duplicateMovieClip("mcImage_reflet"+i, mcThumbs.getNextHighestDepth());

// here any code to move the new movieclip so they dont overlap ;)

anything
}

GC And Array Of Class Instances
When I replace some position in array that was "myarray[5]=new myclass(5)" by "myarray[5]=new myclass(25)", Should GC have a breakfast?

Holding Instances In An Array
I'm working on a project where I have Multiple instances with the same actions.

Instead of typing out

btn1._visible = false;
btn2._visible = false;
btn3._visible = false;
btn4._visible = false;

Could I store these instances in an array so that I could minimize my code to something like:

btnArray._visible = false;

I've tried to do this but it seems to read the instances as strings instead. Someone told me that this was possible once but I forgot the solution.

Thanks for any help

Using An Array To Create Multiple Instances
I am making a very basic shooting game. The player can move a gun left and right accross the ground with arrow keys. When they press the up arrow then the gun should fire a bullet.
For some reason flash never runs the script that will create the instance...it loads the variables and will recognize key presses but wont create the bullet.
If you can take a look at the fla file and tell me where I went wrong...The code is in Frame 1 layer named Actions
Thanks

aaseed = movieclip being recreated
aalist = array name

Array Issue And Counting Instances ?
I have a game that I'm creating whereby certain blocks of text are displayed. The game player is shown a random word/prhase/letter and then within a time limit has to locate as many of those instances as possible.

1) How do I create a scenario whereby through actionscript I can get the code to check for instances rather than me creating variables for every possible combination.

I was assuming that I read all the texts into an array, and then further break down each letter of those text blocks into sub arrays of their own.

Additionally I assume that I could create an array of words/phrases/letters on which the user could be tested.


Is this the right way of doing it ? - and if so, does anyone have any pearls of wisdom on how to read in the blocks of text ? - would it have to be from a .txt file or can flash do it from a text box scenario ?

Thanks in advance.

[CS3] Initialising Class Instances From An Array
I am trying to... have a set of movieclips initialise and connect to instances of a class using "for".
I am not sure if I am going about this correctly, or if I am even attempting somehing that actionscript is capable of...
So far i have:

PHP Code:



*Containing Movie Clip*.onLoad = function (){
for(i=0;i>*Array Name*.length;i++){
    _root["instance"+i] = new *Class Name*();
    _root["instance"+i].mymc = *Array Name*[i];
    *Array Name*[i].myclass = _root["instance"+i];
    trace(["instance"+i])
    }

}




I apologise if this question has already been answered, but I have had trouble finding the right... description... to search for.
Thank you for your time

Remove All Instances Of NodeClass That Are Not In Array
Hey flash AS3 gurus,

I have many instances of a class called NodeClass on the stage.
I have pushed some of them into an Array.
Now I want to remove all then nodes on the screen that are not in the Array.

This code is ok, but I'm having issues with remove all children.

ActionScript Code:
while (this.numChildren)
{
    removeChild(this.getChildAt(0));
}

for (var p:Number = 0; p < IsActiveNodesArray.length; p++)
{
    addChild(IsActiveNodesArray[p]);
}
           
NodesArray = IsActiveNodesArray;

[F8] Removing All Instances Of A String From An Array?
Hey is there an easy way of removing all instances of a string from an array?

Say i had, [0] forward, [1] forward, [2] right, [3] crash, [4] crash, [5] crash
(this structure will change)

How would i remove all "crash" instances? the splice method just doesn't cut it =/

Unable To Access Instances Via Array Or XML
So, in AS2 I was able to populate an Array with Instance Names and, by looping through the Array, effectively apply the same function to all the instances.

I'm trying to do this same thing in AS3. I've got some XML that looks like this:

Code:

<units>
<unit ref="c101" number="101" />
<unit ref="c102" number="102" />
</units>

And my Actionscript goes like this:

Code:

var ref:Object = new Array();
var i:Number = 0;
var myLoader:URLLoader = new URLLoader;
var marmXML:XML;

myLoader.load(new URLRequest("masterlist.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);

function processXML(e:Event):void {
   marmXML = new XML(e.target.data);
   for(i=0; i<marmXML.unit.length(); i++){
      ref.push(marmXML.unit[i].@ref);
      ref[i].cNum.text = marmXML.unit[i].@number;
   }
}

So essentially, the c101 and c102 MovieClips should have thier Text Fields (cNum) populated with 101 and 102 respectively, but I've got nothing. Suggestions?

Flash MX Help With Loading Mc's In An Array Through Linkage Instances PLZ HELP
ok...i am trying to create this dynamic content movie in flash mx...if you are willing to help i have provided links to the files and it is a really cool and dynamic menu system imo...it is scripted to call upon the mc with the linkage instance of "section" and dump it into the empty holder "container_mc"...i thought i had scripted it correctly so that if i were to add more movie clips with linkage instances named section_1, section_2, etc i thought i had scripted the:

_root.content_mc.attachMovie("section", "section_"+i, itemDepth);
curItem = content_mc["section_"+i];

would create an enviornment that would call on those other movie clips externally and replace them with the previous movie clips as the user clicks the top buttons or scrolls...the problem i am having is that i can't for the life of me figure out why the only instance the actionscript is recognizing is the initial "section" movie clip and no others...PLEASE HELP...i am on day 4 of messing with this thing and i am loosing what little mind i have left by the miinute

i have added a link below with both zip and sit versions of my working file...please feel free to dl and take a peek

zip file
mac files

Multiple Movie Clip Instances With An Array
Hey everyone,

I've tried numerous different things, but as I'm still sort of a newbie to flash I still haven't gotten it to work. Here's what I'm trying to do with the preloader I'm trying to make:

I want to have 7 instances of the same movie clip., which contains a dynamic text box, which will contain a letter. On the _main part of the movie, I want each of the 7 seven instances to send its name (which will be the letter it will display L, O, A, D, I, N or G) to a switch statement in a FOR-loop that will assign each clip the appropriate letter after reading in the clip's name. What's the best way to do this?

I'm sure that this is just more of a pain in the butt than its worth, but it seems my curiosity has gotten the best of me yet again.

Thanks in advance for you help!
-Steve

Help With SwapDepths, SetInterval And Array Of MC Instances On Stage
Hi

I am trying to create a slideshow type of feature and was hoping for some coding help. Basically I am loading MCs with individual images in them in a step order on a time line, each MC is on a different layer, the effect being that they quickly pile on top of each other. When done the timeline stops. At this point I would like for a time lapse of about 6 seconds and then for the MC at the bottom of the pile to appear on the top, then after another lapse of about 6 seconds the MC now at the base appears on the top and so on. I have achieved the effect with just swapping the MCs at specific points on the timeline but after 4 images it can get a bit tedious and was hoping there may be a more efficient way t o do this.

My starting thoughts have been to use swapDepths, Set Interval and an array of the MC instances to be placed but my thinking gets muddled there. I have spent the day trailing tutorials but they don't seem to cover this specifically and I have not been able to find anything that I have the capabilities to manipulate. I do not especially want to load preload external jpegs and would prefer to target the MCs on the stage as I have better control as to how they appear initially

I would be really grateful for some outline code to get me started for this or a pointer to tutorial that would be helpful. I am using Flash MX2004

many thanks

Help Unable To Trigger The Instances Form Array
i got one problem here..
i got a array which stores some elements, in string form, and these elements actually represent the name of the instances on the stage. now i want to trigger the instance to reset it's alpha value..
how i dont know how it works.

eg:
i got an array["A"."B"."C"];
Instances name available: A,B,C,D....Z
now how i should do to make the instance A to got triggered?? i call them by using on button.

i try some like _root.name.array[0]=_alpha=0;
but not success.

Creating New Moose.Move Instances From An Array
Last edited by plangent : 2005-02-14 at 11:20.
























So, I've been trying to do it, but it doesn't seem too happy. Here's a sample of how I've been trying to do it:


Code:
for(i = 0; i < myArray.length; i ++) {
myArray = new Array();
myArray.push("arrayItem" + i);
myArray[i] = new moose.Move(Math.noEase);
myArray[i].setTarget(_root, "my_mc");
myArray[i].setDuration(1);
myArray[i].addDeltaProp("_alpha", -100);
myArray[i].async = true;
myScript = new moose.MoveScript();
myScript.addMove(myArray[i]);
}
Any help would be greatly appreciated.

Placing Array Values Into Variables To Control Instances
Hi there, I am having some troubles with pulling some values out of an array into a variable and then using that variable to control an Instance value assigned to a set of buttons.

Frame 1 (scene 1) Actionscript

ActionScript Code:
gMarray=new Array();gMarray[0] = 4; gMarray[1] = 1; gMarray[2] = 1; gMarray[3] = 1; gMenuListarray=new Array();gMenuListarray[0] = "gbLaw";gMenuListarray[1] = "gbPrev";gMenuListarray[2] = "gbPower";gMenuListarray[3] = "gbHandle";


Frame 1 (scene 2) Actionscript

ActionScript Code:
for(i=0; i<=3; i++){ //if i is 3 or less do...    var gTemp1=gMarray[i];    trace(gTemp1);  // display the value held    for(j=1; j<=4; j++){ //if j is 4 or less do...        var gTemp2=(gMenuListarray[i]+j);        trace(gTemp2);        if(gTemp1 == j){ //check and see if the variable in a gM# is equal to j            gTemp2._visible=1;        }else{            gTemp2._visible=0;        }    }}


gMarray is being used to hold a value (for tracking).
gMenuListarray is being used to hold the names of the button instances.

As the script goes through the for loops it adds j to the value of whatever is in gMenuListarray item i (ie. gbLaw1, gbLaw2, etc.) then it checks if the value of gMarray is equal to j, if it is equal it makes the instance name that equals the combined value of gMenuListarray (array item plus j appended to it) visible or invisible on the stage. The problem is that Flash MX 2004 seems to be incapable of reading using this combined value to find and modify the instance, it goes into the loop, compares and then exits out without doing anything. I have check my logic using a trace command to tell me "true" or "false" and that works correctly and I have double checked to ensure that the combined value of gMenuListarray+j equals an Instance name asigned to a button on my stage.

Thoughts? Comments? Suggestions? A hammer to beat this software into submission?

Placing Array Values Into Variables To Control Instances
Hi there, I am having some troubles with pulling some values out of an array into a variable and then using that variable to control an Instance value assigned to a set of buttons.

Frame 1 (scene 1) Actionscript

ActionScript Code:
gMarray=new Array();gMarray[0] = 4; gMarray[1] = 1; gMarray[2] = 1; gMarray[3] = 1; gMenuListarray=new Array();gMenuListarray[0] = "gbLaw";gMenuListarray[1] = "gbPrev";gMenuListarray[2] = "gbPower";gMenuListarray[3] = "gbHandle";


Frame 1 (scene 2) Actionscript

ActionScript Code:
for(i=0; i<=3; i++){ //if i is 3 or less do...    var gTemp1=gMarray[i];    trace(gTemp1);  // display the value held    for(j=1; j<=4; j++){ //if j is 4 or less do...        var gTemp2=(gMenuListarray[i]+j);        trace(gTemp2);        if(gTemp1 == j){ //check and see if the variable in a gM# is equal to j            gTemp2._visible=1;        }else{            gTemp2._visible=0;        }    }}


gMarray is being used to hold a value (for tracking).
gMenuListarray is being used to hold the names of the button instances.

As the script goes through the for loops it adds j to the value of whatever is in gMenuListarray item i (ie. gbLaw1, gbLaw2, etc.) then it checks if the value of gMarray is equal to j, if it is equal it makes the instance name that equals the combined value of gMenuListarray (array item plus j appended to it) visible or invisible on the stage. The problem is that Flash MX 2004 seems to be incapable of reading using this combined value to find and modify the instance, it goes into the loop, compares and then exits out without doing anything. I have check my logic using a trace command to tell me "true" or "false" and that works correctly and I have double checked to ensure that the combined value of gMenuListarray+j equals an Instance name asigned to a button on my stage.

Thoughts? Comments? Suggestions? A hammer to beat this software into submission?

Adding Scene Issue
Hi !
I did flash project in one scene. I put preloader in frond of it (in new scene). Preloader works fine, but the code in next scene doesn't work at all!!!!

I didn't find any solution. I tried to paste all frames to new empty movie with two scenes. Script started to work, but gotoAndPlay commands dont work correctly.

Leos

Trouble With Adding A New Scene
Hi,

I have a main scene that begins with a animation. Now when i add a new scene to house a preloader and place it above the main scene and play the movie the preloader works fine but when it plays the next scene everything stops at frame 1. At 1st I thought it was my preloader but i tripled checked it and it was fine, I also just added a blank scene but i get the same problem. Im using flash 8. ne 1 ever get this problem?

thx

Problems Adding Just A Scene
hi guys,
i am getting in pain just adding a second scene to my flash 8 artwork.
...i have finished an intro and now the movie should jump to a second scene using gotoandplay("scene2", 1).
as soon as i add the second new scene from the scene inspector and play the movie, i get a movie that stops playing to the first (i think it's so) frame of first scene....well at the end ...as soon as i add a scene, the movie stops. no code added or removed!!!it's strange!!!
please helppppp
thank
adro

Adding A Link To Scene
Hi,

I am a total beginner in Flash and wanted to know, how to add a link that opens in a new window to a scene?
I found out that on AS2 it was done in a manner similar to:

ActionScript Code:
on (release)
{
getURL("http://www.google.com",_new)
}
or something like that.
Right now I got to this:

ActionScript Code:
Scene.addEventListener(MouseEvent.CLICK,goTo);
function goTo(e:MouseEvent) {
    var request:URLRequest = new URLRequest("http://www.google.com/");
    navigateToURL(request);
}
But I get an error 1061

Basically I need to add a link to another web page on my banner.

Help please?!

Adding A Scene Distorts Images
This seems very strange to me, but why would adding a scene to the movie lower the quality of the images I am using. I have images that look fine, but if I just add a scene to the movie the quality goes way down.

Thanks for the help,
Todd

[F8] Adding Text Field In Scene 2
I have a two scene movie

In the second scene i have

Code:
createTextField("word_txt", 2000, 100, 100, 300, 100);
word_txt.multiline = true;
word_txt.wordWrap = true;
word_txt.border=true;

var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFF0000;
my_fmt.underline = true;
word_txt.text = "This is my first test field object text.";
word_txt.setTextFormat(my_fmt);


If I export the whole movie this doesn't work

If I export just the second scene it does work.

What do I need to alter to make it work if I export the whole scene

THanks in advance

Adding Up Score From Movieclip To Scene
Hi, I am doing a quiz game project using flash that is due soon. I am having a bit of problem with adding up score from many movieclips and displaying it on another scene.


Any help is deeply appreciated.Thanks in advance.

Blurry Graphics When Adding A Scene
Hello...i'm new at this forum and here's my first question:

When i add an extra scene to my movie (flash MX 2004) than all my graphics become blurry like a bad jpg. When i delete the scene again, the graphics are perfect.

Is this a bug in flash or am i doing something wrong? The graphics I imported are png or jpg.

I tried some changes with the jpg publishing quality, but that didn't work.

So..anyone with the solution?

Thnx in advance.

Adding 2 Sound Fx To A Scene But It Interupts The First Loop
Hi, i am working through one of the tutorials in swish and i have come accross a problem. IN THE TUTORIAL "THIS IS MY MESSAGE" i have added the vector graphics and the initial sound. However i wanted to added a sound effect when the first picture loaded in. When i did this my first sound loop cuts of then startes again when the sound fx is meant to cut in. So i look at sound/actions panel. I loop 88amp3 15 times and then at my first jpeg i loop a sound fx once. But when i play the whole scene my sound fx cuts in through the whole thing. When i go back to the sound panel i find that the setting have changed and the soundfx wants to play 15 times now overiding my initial 88amp3 sound loop. Its just that in future i want to put key sounds along side pics loading in and what not, and im not sure how to co-ordinate this. Anyone know what im doing wrong? Im pretty sure im close but i cant find the solution. Any takers?
Regards,
Gibbo.

Images Look Crappy When Adding Preload-scene
I have an imagesequence that should be exported with the swf in highest quality. Works great on it self and all, no problem whatsoever, UNTIL....

I added a preloader in a scene

Now when I export, the images look all crappy! Almost bitmap-like. I swear I've checked the properties of all images and the export-settings and all that.

Can someone help me with this problem?
Much appreciated,

Mediamonkey

Adding Scene Makes Images Fuzzy
I have a flash movie (flash 5) with imported PNGs for buttons. When I add a new scene (either by duplicating or adding new), the quality of these images plummets, even though I have the publish settings set to 100% jpg quality. As soon as I delete the new scene(s), the quality is restored. Obviously I can't publish a movie with poor quality images (it's like they've been enlarged and then over-sharpened in paintshop pro or similar, except they haven't). Does anyone know if/how I can remedy this? TIA

Help Adding Moviclips/Btns To My Papervision Scene
Please help. I'm new to papervision and AS3. I'm trying to spin a cube with materials and interact with buttons on the cube. I was able to assemble this:

http://www.methodengine.com/clients/...vidboxspin.swf

It shows my cube with my materials. I placed buttons over the box that spin it. I would like those buttons to actually appear and spin on the cube itself.

Can anyone out there point me in the right direction. I was able to add movieClips on the stage, but no in the front cube material.

Here is my code to make this happen:


ActionScript Code:
package {

    import flash.display.*;
    import flash.filters.*;
    import flash.events.*;

    // Import Papervision3D
    import org.papervision3d.events.InteractiveScene3DEvent;
    import org.papervision3d.scenes.*;
    import org.papervision3d.cameras.Camera3D;
    import org.papervision3d.objects.DisplayObject3D;
    import org.papervision3d.materials.*;
    import org.papervision3d.utils.virtualmouse.VirtualMouse;
    import org.papervision3d.utils.virtualmouse.IVirtualMouseEvent;
    import org.papervision3d.utils.*;
    import org.papervision3d.objects.*;

    import flash.text.TextField;
    import flash.utils.*;

    public class Main extends MovieClip {
        public var mc :MovieClip;

        // ___________________________________________________________________ 3D vars
        var container:Sprite;
//    var scene:Scene3D;
        var scene :InteractiveScene3D;
        var camera:Camera3D;
        var ism:InteractiveSceneManager;
        var plane:Plane;
        var time:Number;
        var tweening:Boolean = false;
        var myVidfront:Boolean = true;
       
        var mouse:Mouse3D;
        var vMouse:VirtualMouse;
        var material:InteractiveMovieMaterial;
        public var myVidContainer:MovieClip;

        private var frontMaterial:BitmapFileMaterial = new BitmapFileMaterial("images/player2_back.png");
        private var backMaterial:InteractiveMovieAssetMaterial = new InteractiveMovieAssetMaterial("flv", true, true);

        private var targetrotationY:Number = 0;

        var p:Cube = new Cube(new MaterialsList( {
          front: frontMaterial,
          back: backMaterial,
          left: new ColorMaterial( 0x000000),
          right: new ColorMaterial( 0x000000),
          top: new ColorMaterial( 0x000000),
          bottom: new ColorMaterial( 0x000000)
          } ), 800, 100, 500, 1, 1, 1);

        public function Main() {
            init();
            time = getTimer();
        }
        public function init():void {

            stage.scaleMode = "noScale";

            // add a spin btn
            var spin180_btn:PlayVid= new PlayVid();
            spin180_btn.x = 500;
            spin180_btn.y = 25;
            addChild(spin180_btn);
           
            // add another spin btn
            var spin360_btn:PlayVid= new PlayVid();
            spin360_btn.x = 400;
            spin360_btn.y = 25;
            addChild(spin360_btn);

            init3D();

            addEventListener( Event.ENTER_FRAME, loop );
            spin180_btn.addEventListener(MouseEvent.CLICK, spin180);
            spin360_btn.addEventListener(MouseEvent.CLICK, spin360);

        }
       
        // ___________________________________________________________________ Init3D
        public function init3D():void {

            // Create container sprite and center it in the stage
            container = new Sprite();
            addChild( container );
            container.name = "mainCont";
            container.x = 270;
            container.y = 200;
           
            // Create scene
            scene = new InteractiveScene3D( container );
            ism = scene.interactiveSceneManager;
           
            scene.addChild(p);
            p.rotationX = 0;
            p.rotationZ = 0;
            p.rotationY = 0;
            p.x = stage.stageWidth / 4;
            p.y = -100;
           
            var moreVids_btn:MoreVids = new MoreVids();
            moreVids_btn.x = 480;
            moreVids_btn.y = -130;
           
//      scene.container.addChildAt(moreVids_btn,1);
            moreVids_btn.addEventListener(MouseEvent.CLICK, spin360);
           

            // Create camera
            camera = new Camera3D();
            camera.zoom = 10;
            camera.sort = true; 

        }
       
        private function spin180(event:Event):void {
           
            tweening = true;
            trace(p);
            if(myVidfront){
                myVidfront = false;
                targetrotationY = 180;
            }else{
                myVidfront = true;
                targetrotationY = 0;
            }
        }
       
        private function spin360(event:Event):void {
            tweening = true;
            if(myVidfront){
                myVidfront = false;
                targetrotationY = 360;
            }else{
                myVidfront = true;
                targetrotationY = 0;
            }

        }
       
        // ___________________________________________________________________ Loop

        function loop(event:Event):void {

            if (tweening) {
                if (p.rotationY <targetrotationY) {
                    p.rotationY += Math.sqrt(targetrotationY-p.rotationY);
                    p.rotationY = Math.round(p.rotationY);
                } else if (p.rotationY> targetrotationY) {
                    p.rotationY -= Math.sqrt(p.rotationY-targetrotationY);
                    p.rotationY = Math.round(p.rotationY);
                }
            }
            scene.renderCamera( this.camera );

        }

    }
}

Adding Live Video To A Scene As A Texture?
Does anyone know if it is possible to add live video (streaming) as a texture in a Flash scene using AS3? If so, what software would I require to do this?

Adding New Frames Before Game Scene [mucking Up]
Got a game, asteroids, and it works fine, but when i move the frames along 1 so that i can add an into screen, with high scores and a play button, it throws off all my remove movieClips.

if anyone know as to why, would be great help.

Adding To An Array
If I was making an array that held size, xpos, and ypos.
my question is how to load it.
sdot=newArray();
//code;
sdot[i] =(xsc,xpos,ypos);

Thanks

Adding To An Array
I have an array full of numbers...


build = new Array(2, 0, 1, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 0, 1, 1, 2, 0, 2, 0, 1, 1, 2, 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0)

and if I want to add a set of number (according certain rules.. ) to this existing array example.... 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0 to make...

build = new Array(2, 0, 1, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 0, 1, 1, 2, 0, 2, 0, 1, 1, 2, 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0)


how would i do this.. whats the syntax... to add numbers to the end of an array...

[HELP]Adding An Array To Another
How do you add an array to end of a previous array? I'm pretty sure I've seen it somewhere but I can't find it. I want something different from concat(), I want to just add to one array, not make a new one.

Copyright © 2005-08 www.BigResource.com, All rights reserved