ActionScript 3.0 :: Duplicating And Manipulating Loaded SWF?

Nov 12, 2010

I am trying to make a card game.

The main fla file loads an external swf file that is a movie clip that has the card art images (one card art on each frame)

This works good and I can view the loaded swf on the stage.

public function FinishedLoading(loadEvent:Event):void {
LoadedMovie = MovieClip(loadEvent.currentTarget.content);
addChild(LoadedMovie);
}

What I want to do in another function is to duplicate the load swf, so that I can have 52 of the same object, each with a different picture. I need to know how to create an instance of the loaded swf.

I would like to control each instance of the loaded swf by telling each one independently of each other to go to and stop at a specific frame such as 3 or 17, or 43, based on what card is needed at that time.

This code creates an error:

var NewCard:MovieClip = new LoadedMovie();

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Manipulating An Ext Loaded Swf?

Feb 7, 2010

So I have a simple as3 project i'm creating in FlashDevlop and I was hoping to create the layout as a simple swf thats loaded in then move the assets where they need to go. Things like roll over states would be stored on different frames to make it nice and easy for designers so they don't have to know flash. And loading it is no problem but how do you target the movie clips inside it or how do you even attach it to the root? When I say target I mean as in how would I target it to change say the height or width. I know this is broad question so even pointers to a good FAQ or example project would be helpful. I spent a little time on google but all im finding is how to load a SWF not how to deal with it afterwards.

View 1 Replies

ActionScript 3.0 :: Duplicating Swf's That Are Loaded In From An External URL?

May 5, 2011

I'm working on an online flash gaming platform. We load all our graphics in externally from a library. I want to be able to load something in, then duplicate it for reuse.

So, I came across senoculars example code for duplicating DisplayObjects. This is where im getting problems. Some of the loaded assest have a few bits of timeline code (basically stop() on animated parts which have multiple animations. also, there are locators in there which are used for the collision detection engine, and these have this.visible=false commands in them).

When i load in a graphic asset, everything works fine- all timeline code executes, the loaded in swf behaves exactly how i want it to. When i duplicate it, buried timeline code is being ignored. Also, even more bafflingly- until i put some kind of timeline code on the top layer of the movieclip that is being imported and duplicated, the duplicated display object wouldn't display at all when added to the stage. (just putting a stop or trace at the very top layer made it work)So i do something like this to load a swf in, and duplicate it

Code:
var myDoAfter = function(mcLoader:Loader)
{
loadedGraphic = mcLoader.content
var newClone = duplicateDisplayObject(loadedGraphic)

[code]...

I've waffled already, and have tried to keep the code brief. Im sure some people are going to say 'never put code on the timeline in AS3' which is probably legitimate (its not all my doing).Still, i am intreagued to suss it out. Is it that, using this method of duplicating (ie getting the constructor of the thing im trying to duplicate), timeline code is simply going to be ignored?

why can't i duplicate something unless it has some timeline code at the top level? Even when it doesnt, the initial load of the asset works correctly- i can add the original to the stage, but its clones seem to be empty.Might it be something to do with the casting of the thing loaded in? (ie that Loader.content is going to be a displayObject rather than a MovieClip) ?

View 3 Replies

ActionScript 2.0 :: Duplicating Dynamically Loaded Image?

Feb 27, 2006

I'm building an image gallery which creates thumbnails by sizing down the original images and once you click on one of them it duplicates itself and displays on top with full scale. I searched the web and everybody say duplicating dynamically loaded image can not be done and only solution is to reload the image. And because they are cached when they were first loaded it shouldn't take much time to get loaded. Also I heard that there is way to force the browser to cathe the image...

View 2 Replies

ActionScript 2.0 :: Duplicating And Positioning Movieclips Loaded From An Xml

Jan 24, 2005

I'm working with a script that loads from an XML some jpgs, these ones once loaded move to their positions.

[Code]....

the problem is that i would like put all these movies well aligned in rows and columns, i've seen it's possible to do this with a nested for.. loop, something like this

[Code]....

View 3 Replies

ActionScript 3.0 :: Flash Loaded Swf Timeline And Duplicating When Adding To Stage?

Sep 7, 2010

I have a couple swfs that are loaded in using Loader, my first problem is I want to stop the timeline until another function when I want it to start. so In the complete function I have

var swfMC:MovieClip = e.target.content as MovieClip ;
swfMC.stop();

but the swf still runs through.Another problem I am having is whenever I add it to the stage it seems to make a duplicate of the swf, and when I remove this duplicate it remains til flash finally crashes. There isnt anything but simple tweens in my swf's (and added trace statements), so they shouldnt be held into memory. that and they shouldn't have been duplicated in the first place... right?

View 1 Replies

ActionScript 3.0 :: Duplicating An Image Loaded - Clone Image?

Oct 2, 2009

How should I go about cloning an image loaded form the server and adding it to the end of the first image loaded? Would I use bitmap clone? My attempts with this failed[URL]

Code:
//Creates new image loader
var imageLoader:Loader;

[code].....

View 1 Replies

ActionScript 3.0 :: Duplicating A Loaded Swf - Error "An ActionScript 1.0/2.0 SWF File Has Loaded An ActionScript 3.0 SWF"

Dec 3, 2008

I'm using the suggested method of duplicating a swf that has been loaded by a Loader object. However, the player thinks my swf is AS2 when it definitely is AS3. The Error Message: Quote: Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScript 3.0 SWF will not run. The duplicate a swf stratgey:

[Code]...

View 9 Replies

ActionScript 2.0 :: Manipulating MCs Attached To Other MCs

Aug 31, 2004

How do you address a mc attached to another mc?I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.[code]How do I now manipulate the "ExtraMC" movie clips? I know I can use parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?

View 2 Replies

ActionScript 2.0 :: Manipulating Non Selected MC's?

Mar 26, 2009

I have a menu with 5 menu items that when an item is selected, the non-selected items need to be moved. All are movie clips. When user selects item 1, the remaining items will slide underneath item 1. I want to make a custom function so as to alleviate unnecessary code. I am moving the MC's with tween class.

View 1 Replies

ActionScript 2.0 :: Manipulating MCs Attached To Other MCs?

Aug 31, 2004

How do you address a mc attached to another mc?

I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.

ie.

for (i=0;i<BasicMCArray.length;i++) {
_root.BasicMCArray[i].attachMovie("myExtraMc","ExtraMC" + i,depth++);
}

How do I now manipulate the "ExtraMC" movie clips? I know I can use _parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?

View 2 Replies

ActionScript 2.0 :: Loading & Manipulating Movies (CS3)

May 5, 2009

i have a photography website, the main 'index.swf' file has two scenes, one for the loader and one with the content.i have a navigation menu:item 1, item 2, item 3, and so on. i have 10 layers, my nav menu is on layer 10, at the very top.i also have a a layer for each one of my navigation menu content. Now i click on item 2, and i load a external movie clip called "fotos_mc" on to the stage and inside this movie clipe i load pic1.swf using: loadMovie ("pic1. swf", 1);it loads fine, except that it loads on top of my navigation menu, logo and so on, even it's on a layer that's under the layer where i have placed my menu and logo. is there a way that i have load my movie so that it displays behind my menue?

View 3 Replies

ActionScript 3.0 :: Manipulating Object In A TileList?

Oct 2, 2009

Okay, so I am filling a TileList component with custom "ChordUnit" MovieClip objects, each of which is associate to a ChordUnit ClassI've established a way of determining if any of these objects are being moused over or clicked:

public function setChordBinSong(song:int, extend:Boolean):void {
dpChords = new DataProvider();
for (var i=0; i < activeChords.length; i++) {

[code].....

View 10 Replies

ActionScript 3.0 :: Manipulating With MovieClips In Array

Jan 22, 2009

I want to dynamicly add images from XML to movieClips and then add event listeners to these movieClips. What is the best solution? XMl loads correctly, it also add 2 movieclips on stage, but it throws errors when I try to add event listeners to movieClips. How could I do that? I want to go to different frames on release of some movieClips. How can I please recognise each movieClip and manipulate with that movieClip ? (resizing,...)

[Code]....

View 1 Replies

ActionScript 3.0 :: Manipulating MovieClips In An Array

Jan 19, 2011

I have a rather unusual problem. I've got an Array consisting of ten different MovieClips (all pre-placed on the stage), and would like to be able to manually use the gotoAndStop and gotoandPlay commands on these via the array. I've tried ActionScript Code: //This script does not work IconArray[1].gotoAndStop(1); however it simply throws out an error. Is such precise manipulation of MovieClip arrays even possible, and if so, how would I code it? (Nb: I've looked at the ForEach method, but couldn't find a way to make it sit my current dilema).

View 4 Replies

Loading And Manipulating MovieClips Fullscreen

May 5, 2009

I am working with a site that's similar to : [URL]. When you click on Wedding Site and then go to the gallery, you will see the pics loading full screen and the navigation bar on top of the pics. What I have done is I have made each one of this pics a separate .swf file so
they load individually once they are called using the " loadMovie("pic1.swf") code line. On layer 10 (being at the very top) I have my menu so it will always display on top
of anything else. Now on layer 3, frame x I have a movieclip called : fotos_mc,
inside this fotos_mc on layer 1, frame 1 I call the swf using the code above:
"loadMovie(pic1,swf");
However when the picture loads, it covers the full screen on top of my navigation menu, on top of my logo etc. Which I dont understand why if the layer where I have placed my fotos_mc is under layer 10 which contains my menu and my logo.

View 4 Replies

ActionScript 2.0 :: Manipulating The Imported Movies?

Oct 28, 2005

I have a list of external movies. I want to import them only once and then use them as many times as I want. I need to attach them to other clips the same way I would attach them if they were in my current library with linkage option on.suppose i have a movie called s1.swf in the same location with my movie. then I have this code:

Code:

function createObj(objname, whichMc, level) {
_root.createEmptyMovieClip(objname, level);
_root[objname].createEmptyMovieClip("mc", 1);

[code]...

I don't know why the event handler for the movie "mc" is not invoked ... I have no trace record in the outpus window.

View 1 Replies

ActionScript 3.0 :: Manipulating Shape At Run Time?

Feb 12, 2009

anchor points for manipulating shape at run time?

View 2 Replies

ActionScript 3.0 :: Accessing A Variable Within Another MC And Manipulating?

Aug 10, 2011

I have an mc with the variable called "Section" and I want to be able to change the contents of this variable from another MC. I have tried MovieClip(parent).mcInstanceName.variable = "normal"; But that doesn't work.

View 1 Replies

ActionScript 3.0 :: Manipulating Class References In A Array?

Feb 27, 2010

i retrieve a list of instances located in a array to manipulate them in a variable holder. Normally, the operations can be made between two instances stored in a simple variable to variable fashion and it works realy fast.I analysed two main operations: retrieving references in a array to a variable and get or set a value from the variable reference.Here are the objects used to perform the test operation:
 
var v4:Vector.<Person>= new Vector.<Person>();//List of Persons instance
var refHolder:Person; //Typed referencevar refHolder2:*;   //Not typed reference
 Test #1: looping 200 000 times and only retrieving references from the array v4.[code]........
 
So my conclusion with that test is that with a typed reference you spend more time assigning a reference than manipulating a value from the reference With a not typed reference, the time spent is in manipulating the reference in the variable.Which one should i use or what should i do to have better performance with manipulating references from arrays?
 
Here are the files i used to test this:
reference.swf     //Online example
reference.zip     //Source file

View 6 Replies

ActionScript 3.0 :: Manipulating Flash Library MovieClips?

Jun 24, 2010

I drew up some graphic symbols in Illustrator and imported and defined them as MovieClips in the Flash library. That way I could just place them where I want to visually on the stage. As I have been solidifying the visual design, I have been implementing it in Actionscript to access the flexibility the code provides.

In order to port a symbol to actionscript I did the following:

[Code]...

View 5 Replies

ActionScript 3.0 :: Loading In An Image At 300 Dpi Manipulating It And Saving It As A 300 Dpi Png

Feb 27, 2012

I have a project where the user uploads a large 300dpi image, then manipulates it (drag it, rotate it, position it). And the user can reuse this 300 dpi image, basically to make something like a t-shirt pattern. Then when the user is ready, they save this t-shirt pattern, and the save format is a large 300dpi png. This saved png file is for printing.  Now I figure I can have PHP take bitmap data (as binary I assume) and the php can create the png. Is it a good idea to use Flash for this?  I will have to scale down the users loaded 300dpi image so they can position. Then I assume scale it back up when it comes time to save Does anyone think Flash can't handle this?

View 4 Replies

Using Vector Or Raster Graphics When Manipulating 3D Artwork?

Nov 20, 2009

I've got a project that heavily utilizes the new 3d artwork tools in Flash CS4. My question is has anyone done any tests to see if Flash is quicker with raster or vector graphics? My SWF really bogs down on slower machines.

View 2 Replies

Flex :: Programmatic Manipulating With Chart Elements In AS3

Dec 5, 2010

When I hover the mouse above the chart elements, it can show some standard hints. How can I show the tooltips without hovering?

View 1 Replies

ActionScript 2.0 :: Manipulating And Displaying Remote Images?

Oct 22, 2009

I've been handed a few Flash files written in CS4, but in ActionScript 2. I know enough ActionScript to be dangerous, but I am far from a Flash developer.

At the high level, the Flash file loads an image, rotates a portion of the center of the image, and allows the user to drag the rotated piece into the proper position (solving a puzzle, basically).

This worked GREAT when the images were loading from the local server. We've changed to remote cloud hosting for the images, though, and now are experiencing issues.

The images still load (we have all of the security and cross-domain policy files in place), but any time we try to rotate the center portion of the image we get a plain gray box instead of the rotated portion of the image.

What's weirder is that the rotated image portions show up fine in the IDE Flash player. But when viewed through a web browser the static portion of the image will load, but the rotated portion will not.

View 0 Replies

ActionScript 3.0 :: Manipulating Multiple Shapes On The Stage?

Dec 3, 2010

I want to add multiple rectangles to the stage and manipulate them on an individual basis. Here is my code:

<code>
var rectangle:Shape = new Shape;
rectangle.name = "firstrectangle";
rectangle.graphics.beginFill(0xFF0000);

[Code].....

I get an error back that says firstrectangle and secondrectangle are undefined.

View 4 Replies

ActionScript 3.0 :: Manipulating A Circle, Using Two Transformation Matrices?

Aug 31, 2011

I am having trouble with some code, I am trying to get a circle to rotate around a center point, as well as rotate in a circle. at the same speed as its parent circle. however I am having some trouble, and I know it is from how I am transforming the position of its matrix, however I honestly can not find the mistake. below is the code:

ActionScript Code:
import flash.display.Sprite;
import flash.geom.Matrix;
var outcirc: Sprite= new Sprite();

[Code].....

View 1 Replies

ActionScript 3.0 :: Manipulating Instances From External Class?

Feb 3, 2006

I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:

for (var i:int=0; i < numChildren; i++) { trace(getChildAt(i).name)}
(and get: instance1, instance2, etc.)

How do I record the instance into my external class? Something like:

(very rough example)
var bar1:Object = getChildAt(i);
var bar2:Object = getChildAt(i + 1);
etc, etc

I've tried pushing them into an array. No luck.

View 4 Replies

ActionScript 2.0 :: [Flash 8] Manipulating Objects In An Array?

Aug 8, 2006

This should hopefully just be a quickie. I'm slowly starting to learn Flash and Actionscript and right now I'm a bit more stuck than usual. I have an array, "container", to which new movieclips are added by clicking a button. When they are added they are given a name, "pic" + i, and are added at the corresponding index "i". Now, what if I want to change the position of a certain movieclip in the array or alter its alpha value? I tried something like:

[Code]...

View 4 Replies

ActionScript 2.0 :: Manipulating Class Generated Movieclips

Sep 24, 2006

I have been able to draw rudimentary shapes on the main timeline by importing this class on the main timeline (first frame) and plugging in the requisite parameters.[code]When I have created movieclips without actionscript, then attached AS 2 classes to them I can manipulate them. If there is not a way that I can manipulate AS-generated clips on the main timeline, is this doable from within the class?

View 4 Replies







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