ActionScript 2.0 :: Saving Instanced Graphics From Flash?
Aug 24, 2007Anyone knows if there a way to make an "EXPORT IMAGE" button to save an instanced graphic in actionscript?
View 2 RepliesAnyone knows if there a way to make an "EXPORT IMAGE" button to save an instanced graphic in actionscript?
View 2 Repliesi am trying to receive in my function as a parameter either a shape or a sprite and then access their graphics property, but this gives me an error:
Code:
public static function makeRect( obj:DisplayObject, ...
var g:Graphics;
if(obj is Sprite){
[code]...
//1119: Access of possibly undefined property graphics through a reference with static type flash.display:Graphics.
I have a mc1 in the library and corresponding Actionscript file referenced, but for the life of me, I can't get instanced DisplayObject on the stage (other than physically dragging and dropping the movie symbol on the stage).
Below is the code:
package {
import flash.display.MovieClip;
public class InnerRing extends MovieClip {
[Code]....
I have a problem with an externally defined class. It cannot be instanced.
the Script: [URL]
I'm currently working on a project where people can drag different symbols (man, woman, house, building, etc) onto a stage to create a graphical representation of a scenario.
I have been able to make draggable classes with different symbols. What I'm finding difficult is the ability to dynamically change these instanced classes using the color picker.
Example: Let's say the user has added two "man" symbols (being external classes) onto the stage. How would I code the ability for the user to change the color of one man symbol to red and the other to blue. I'm finding it quite difficult to achieve this since both man symbols are from the same class.
I'm making a screensaver where random characters in different positions and sizes walk/run across the screen. It seemed simple enough, and everything appears as they should. However, none of the Movieclips move forward on the stage. Here's the code on the first frame of the timeline, bolded lines are points of possible concern:
Code:
import flash.utils.*;
var timer:Timer=new Timer(5555);
timer.addEventListener(TimerEvent.TIMER, makeCharacter);
timer.start();
function makeCharacter(e:TimerEvent):void {
[Code] .....
And here's the code found in each movieclip:
var isOnStage:Boolean = true;
With no errors to go off of, I'm unsure how to proceed.
I'm working on building a 'cover flow' similar to the scroll through iTunes uses for it's album covers. The only difference is my 'cover' needs a background MovieClip that will sit behind it and animate when the images are scrolled to get it a 3D effect. So I have a MovieClip I'm exporting called coverflowItem. This is the movie clip that will sit behind each 'cover' image and have the timeline I want to control from a different .as file. That file is called coverflow.as where all of the elements are assembled and animated.
What I need to do now is find out how to control each instanced coverflowItem so when the arrow buttons are clicked, not only do the covers slide to the appropriate side which they are currently doing now, but also have the associated MovieClip play giving the 3D illusion. I can call the functions from the coverflowItem.as in the coverflow.as but have had no luck actually getting the movie clips to play properly.
//Create CoverflowItem
var cover:CoverflowItem=new CoverflowItem(_data);
This code lets me assess the functions but not actually manipulate the MovieClip. I'm sure my logic if flawed.
I'm having a problem with removeChild(x) not completing purging the object. I run an if statement to see if the object is null before creating a new one, once I create it the first time it is never null even after I removeChild(x) so the if statement fails.Note: There aren't any external EventListeners in the shop to removethis seems like a simple fix and is driving me up a wall In the parent I start off with a placeholder:
Code:
public class main extends MovieClip
{
[code]....
I was wondering about MC and hey can help to lag a game out. I set up an advanced class system so i don't have to use MC to simulate walls, all i use isthe x,y,width and height. Well anyway since i don't need MC anymore I was wondering if there is a way to attach Graphics instead of MC cause a Graphics file size is relatively small than that of a graphic, I think. If anyone could tell me thats true and show me a way to attach graphics that would be nice. I haven't tried it yet but maybe if I exported the graphic from the library imihgt be able to call its name, but it doesn't have an instance name so im stuck.
View 2 Repliesis there a way to scope instances that haven't been instanced in the first frame of the movie?I got brave and nested my btn_mc clips inside a nav_mc.On an action layer in the first frame of my timeline I have:
_root.nav_mc.btn1_mc.gotoAndPlay("start");
for example.In the nav_mc timeline this works if and ONLY if the btn1_mc instance is on the first frame of the nav_mc timeline.I'm trying to update my skillz and put everything in the first frame of the root timeline rather than doing the backasswards syntax on the mc itself this (onPress) which really confused me for about five years.
I had a problem recently with as3 and found no answer about this issue, I did a game with a client's container. This container has a custom loader function to load resources, so I loaded a swf with linked movieclip's based classes, these movieclips have frame scripts like stop() and dispatchEvent(..). It actually loads the resources, I instanciate them and their frame script WORKS. Now, I'm making a standalone version without the container:
1 - I load the same swf, using the standard flash loader.
2 - I instantiate the classes and add them to stage.
3 - The framescript is totally missing. The frame scripts like stop(), trace() and etc, aren't executing anymore.
I did a lot of research on the web, and found very few people with the same issue but no answer. I tryed a lot of workarounds but nothing seems to happend, I think is a security-loader issue, but now I am clueless.
I am trying to get an instance of a class to the load an external swf and show it.So far I have the following:
1) I wrote a class that uses the Loader class to load an external swf "loadExtSWF".
2) I have a fla named "MainSWF.fla" that uses a document class "MainSWF.as".
3) I have the MainSWF.as file that instances "loadExtSWF" and calls loadExtSWF.startLoad to load the swf.
This almost works. The instance of loadExtSWF loads the external swf, but the swf is not displayed.If I replace the fla's document class with loadExtSWF (this has an empty constructor) instead of MainSWF, and run loadExtSWF.startLoad, then the external swf is loaded and displayed.[code]
I have a large vector drawing (imagine 5000x5000) that i want to break up into separate pieces. I know that I can convert this vector drawing into a bitmap and then use the copyPixels method to create many separate bitmaps of the different regions of the original vector drawing, but is there any way to subdivide it into movieclips that just contain vector graphics instead of a bitmap?The reason im dividing a big chunk of vector graphics into smaller pieces is for performance reasons, so flash would only render a small part of this big chunk at a time (only certain regions/voxels/subdivisions are rendered at a time). But bitmaps apparently take up a lot of memory and the system im using would take much less memory if these subdivisions could be preserved in their original vector graphics form.
I imagine I could use masks somehow to achieve this effect (for each subdivision, duplicate the huge image and mask only the region that the subdivision represents), but I dont know the performance costs of masking or if this will create other problems.So is there anyway to split up a movieclip of vector graphics into smaller movieclips of vector graphics the same way copyPixels can with bitmaps?
In Flash the cursor won't move if I use my tablet, but it moves if I use the mouse.. the tablet works outside of flash, like in paint. I use Windows 7 if thats the problem. Yes, I do have the latest drivers for Windows 7.
View 1 RepliesIs there any program or setting for "pointing" flash programs at my graphics card rather than leaving it to the processor and RAM alone? I am running a specific frontend software that is a flash executable- unfortunately it lags heavily on execution despite the fact that I have a very nice video card installed.
View 3 RepliesI can't seem to find free vector art made with flash. I want something like an FLA file I could open up and have a button or something nice looking to copy and paste. Does such a place exist?
View 2 RepliesI have downloaded the latest flash pro cs5.5 package and installed it on 3 different windows XP machines and I get the same bad result. This is Flash Pro 11.5.0.325 on XP SP3.
I made a small slideshow swf consisting of two jpeg images and nothing else. No music or other bells or whistles.Just 2 images converted to symbols, some keyframe/tween definitions with altered alpha channels.The slideshow runs perfectly and as I expect.
I save the slideshow as a .fla file.I need to add some more functionality from this plateau to show that the product can do what we need to the boss.
When I later load this .fla file, I don't see my graphics on the stage anymore. I right-click on the images and click on the option in the dialog to update the images. I see that the white stage now has the image I expected. When I close the dialog that lets me update the image flash pro abends and I get the crash dialog from microsoft.
Why can I make this slideshow and have it run perfectly, save it successfully (so I think) and then it won't load properly or let me work on it after one save?I have downloaded the latest flash pro cs5.5 package and installed it on 3 different windows XP machines and I get the same bad result. This is Flash Pro 11.5.0.325 on XP SP3.
I made a small slideshow swf consisting of two jpeg images and nothing else. No music or other bells or whistles.Just 2 images converted to symbols, some keyframe/tween definitions with altered alpha channels.The slideshow runs perfectly and as I expect.
I save the slideshow as a .fla file.I need to add some more functionality from this plateau to show that the product can do what we need to the boss.
While doing a tutoral it wants me to go to the library and select a pre-installed graphic.When I go to Window and open the Library it is empty. And under Window/Common Library's to submenu has three choices, Buttons, Classes, and Learning Interactions. Does Flash have a gallery of sample graphics and animations installed in Flash Professional 8? If so how do you open it?
View 4 RepliesIn AS3 you can embed a graphic into a Class variable:
[Embed(source="MenuAssets.swf", symbol="topSquare")]
public var TopMenuItem:Class;
I have hundreds of assets in this one website project I'm doing, so I want to embed assets into an array for quick access.Can I do something like this? Its not compiling so I'm wondering whether its possible.
public var MenuAssets:Array = [
[Embed(source="MenuAssets.swf", symbol="topSquare")],
[Embed(source="MenuAssets.swf", symbol="botSquare")],
[code].....
I am developing a Flash CS5 iOS app. On one of the frames I am drawing a good many rectangles in a particular pattern. I would like to use two-finger zoom and gestures to zoom into these rectangles on the frame but keep the general pattern of these rectangles the same. Also once zoomed in, the user will need to pan around the enlarged graphics.
I know I could create an event handler that when I zoom in it adds width and height to each of the rectangles but then I have to worry about increasing the X and Y positions of each of the rectangles so I keep the same distance between each one and so forth.
Our scenario is that we have a visualisation in a flex .swf that we load data into (through a web service call). Once the data has been loaded we would like to use the resultant image in a PDF.I can send an image of a DisplayObject back to the server as a PNG and put it into a PDF (using iText), but the png is not scalable and it looks bad in the PDF at different zoom levels.To add a bit more clarity. The visualisations are not vector graphics that we import or embed during development, they are charts and trend graphs and custom visualisations created through the flex/flash drawing API, at runtime, based on data retrieved from the server.
View 3 RepliesIm trying to save from fla or swf to .mov or .avi. without having to buy a 3rd party app.I've tried exporting from Flash but both my computers just sit there and don't finish the job.I can't see any options to save as an .avi file either.I've tried opening both the swf and fla files in Quicktime with Perian
View 3 RepliesIs there any way to erase a part of flash.display.Graphics canvas? Like
[cODE]....
This produces just a red square (the last 3 calls are noop), and what i need is a transparent square hole in it.
I've done some searching and can't find a good answer on workflow for importing vector graphics in Flash 8.I created a layered Photoshop file and opened in Illustrator to save in .eps format. I'm using Flash 8 and Illustrator CS3. I've tried many options (including trying to simply create my buttons in flash), but can't seem to get the buttons to import properly for scaling purposes into Flash.
View 3 Repliesam working on developing and programming for games, having 2+ years experience. Now I want to learn more about Flash Lite and 3D Graohics Programming. me some of the best sites I can check and especially some offline resources/trainings
View 1 RepliesI noticed this thing that Flash self generated graphic symbols and names it Tween1, Tween2, etc. I am not sure why it happens. Usually it happens when I tween something and then this accompanying graphic symbol appears in the library. Do I really need them, is it a flash mulfunction and I can safely delete them? why they are happening, am I making all the wrong steps in tweening and thus they appear?
View 1 RepliesLet's say I create an empty movieclip called "Test_mc", then I create an as3 class "Test_mc" like below and then I set the movieclip class to "Test_mc".
public class Test_mc extends MovieClip {
public function Test_mc() {
graphics.beginFill(0xFF0000);[code]..
Now I can drag out instances of the Test_mc into the scene and get red circles when I test the movie. The problem however, is that I can't see the circles on the canvas inside the Flash IDE. Is there a way to get these actionscript generated grapics to show up?
I am trying to import a FlashDevelop project into Flash Builder. I simply started an ActionScript project and dragged and dropped files & created packages as needed, selected "Set as Default Application" on the main file .as file and deleted the default application .as file. But when I compile I get the following errors
[Code]...
In my build path I have Flex 4.5.1 and for framework linkage I am doing "Merged into code".
I would like to do something like this:The flash project loads any vector graphic object from hard disc (that graphic has only two color), change one color (for ex #ff0000) to an other (for ex #00ff00) and display.
View 1 RepliesIf I have a sprite, with which I have drawn some stuff, how do I erase part of what I have drawn? Preferably I could use drawRect with some "alpha=0" paint. However, I don't believe beginFill lets you set an rgba color (like you can in bitmapdata). Setting alpha = 0 in beginFill doesn't really do anything -- it just draws nothing. In my particular use case, masking isn't an option. Also, calling clear() isn't a good solution since it clears away everything.
View 3 Replies