ActionScript 2.0 :: Using CacheAsBitmap W/ Internal Timeline

Jan 4, 2008

CacheAsBitmap stores a raster copy of a movieclip in memory to use. If that movieclip is rotated or scaled, the performance gain is lost as it must re-cache the new movieclip. I assume this also applies to a movieclip that has a constantly repeating internal timeline, even if that movieclip isn't rotating or being scaled. However, do additional frames (that aren't being used) affect this?I have a 'player' movieclip. This movieclip consists of about ten frames, each its own animation. Idle stance, walking, jumping, all the standard stuff. THe movieclip remains stopped on frame 1 (idle stance) for most of the game. Right now the Idle stance is an animation, so to use cacheAsBitmap I need to stop the idle animation. That's fine, but does the additional content in the movieclip interfere with this? If I go from a walking animation back to the idle stance will it re-cache the idle stance for me?

The main reason I ask is that I wasn't able to notice much of a performance difference between either method. Cacheasbitmap on a player sprite with animated idle stance, and Cacheasbitmap on a player sprite with a static idle stance. Both resulted in 39 fps (set to 40) in the flash player. Which is good I suppose, but I don't know how the results will vary for someone with a slow computerThis is an important area of the game because at any given time there could be up to 12 player sprites on the screen (all with filters attached to them). So if one player is moving left/right the other 11 must be re-translated on each frame (since the stage moves too) so if all 11 players are playing their idle animations, with a glow filter, WHILE flash tries to re-cache all of them, that could lead to performance issues (although it hasn't yet for me)I want to give players the option to disable the idle animation, I just hope that it's actually working the way I intend. If cacheasbitmap fails because of any other content inside the movieclip then this would be a useless feature.

View 1 Replies


Similar Posts:


Actionscript 3 :: Get Access To The Internal Bitmap Used By CacheAsBitmap?

Feb 16, 2010

is it possible to get access to Flash's internal bitmap cache of an object when CacheAsBitmap is on ?

eg, something like:

var bmd:BitmapData = someDisplayObject.getCachedBitmapData();
if (bmd != null)
trace("stoked!");
else
trace("bummer. got to bmd.Draw(someDisplayObject) ourselves.");

View 1 Replies

ActionScript 3.0 :: Variables In Main And Internal Timeline?

Aug 26, 2010

I have movieclip that act as a container for a short animation. This animation has a script that repeat the movements until it's greater than a variable. But I wonder if it's possible to use this movieclip on several places on the timeline and have a several variables with different max number of movements that control the script inside the movieclip container? I have tested, but it seems like the value from the variable at the main timeline don't reach the script in the container!?

View 2 Replies

ActionScript 2.0 :: Controlling A Movieclip's Internal Timeline W/ X+y?

May 21, 2010

Im really struggling with controlling a movieclip (frame-by-frame images w/ stop(); actions) by using the mouses horizontal position on the main stage. So basically I want to turn my stage into a showreel of images. Lets say the stage is 50 pixels; i would want some kind of code that would divide up the total length of my m/cs timeline, in order to show the first frame of the m/c when the y-axis is at 0, the last keyframe of the m/c when the y-axis = 500.

I have tried to use rollover commands on (miniscule) hit states covering the entire stage, but there must be a better way ( i plan on updating the images m/c a lot) ie. a lovely big chunk of confusing code?

View 2 Replies

External And Internal Links - Move To A Frame Outside The Main Timeline

Jan 3, 2010

Not sure if I'm in the right place, I apologize in advance if so. I'm somewhat proficient with html, but fairly new to flash, using cs4pro, as3. Here's my dilemma. Converting an existing html/css site to flash. Flash is main site now but a few html pages are still linked, a buy page and a form page, a few others. I can get the all the external html pages to link to a frame in the flash movie, and I can get the flash to link with all external urls.

My problem comes when I move to a frame outside the main timeline. The movie is lets say 393 frames. All symbols/content are on seperate layers, and so is the action. Once the full movie ends, I have several frames past that where I have basically created frames for additional "pages" and created anchors for those frames, new layes for content, new layers for anchor (labeled) and new layers for a stop(); on each frame, I extended the pertinant graphic frames out to 410 from the original movie.

Now when the movies runs the buttons appear at about frame 115, so in the action layer I coded a keyframe and then added frames of it out to frame 410 or so: I have attached the .fla Now I'm lost here. When you navigate the site, from home lets say to an external link (button) like members, the html member page opens, and if you click home button, back to flash frame, and all works, all buttons, on the home frame 393. But if you go to any of the external htmls, and then go back to any other frame like frame 401 the about page, and all the rest 402 403, etc, the page appears properly, but then none of the links function. the site URL is [URL]there is a flash intro too, swf in question is actually at[URL]

View 2 Replies

ActionScript 3.0 :: What Is Internal And The Use Of Internal In OOP

Jun 26, 2009

I am unknown about internal in OOP. Is there any body about internal. How we can use this in pratical world

View 1 Replies

ActionScript 3.0 :: CacheAsBitmap - X,y Become Ints?

Mar 7, 2009

when cacheAsBitmap is true, do x and y suddenly become ints? im ok with them being drawn this way, but my calculations require x and y to be numbers, because else strange behaviour occurs, which is happening now.

View 6 Replies

ActionScript 3.0 :: CacheAsBitmap And HitTestPoint?

Sep 19, 2011

Why does hitTestPoint isn't working on DisplayObjects that has cacheAsBitmap set to true?It does work, but it takes the Whole rectangle of Display object, not respecting wheather or not pixel is transparent or not (transparent pixels return true after hiTestPoint)

View 3 Replies

ActionScript 3.0 :: 3D Prevent CacheAsBitmap?

May 30, 2011

Is there any way to add 3D properties like .z and .rotationY without the MovieClip's cacheAsBitmap property being automatically set to true? This automatic cacheAsBitmap to true messes up the visual of my MC (which is using a lot of bitmaps and filters) as soon as I rotate it in 3D. And turning it "off" right after it doesn't seem to work.

View 2 Replies

ActionScript 2.0 :: Cacheasbitmap Bug Cs3 / Flash Player 9?

Aug 19, 2009

Start a fresh AS2 document using its default publish settings. Draw a circle on the stage and convert it to a movieclip. Name it for example "my_mc". Apply a motion tween to it from left of the stage on frame 1 to right of the stage on frame 20. Test it and the circle moves from left to right.

Now apply this code on frame 1:

code: my_mc.cacheAsBitmap=true;

Test it again: the circle doesn't move; it freezes on its left position of frame 1.

Now change the publish settings from 'flash player 9' to 'flash player 8'. The motion tween now works again

Is this some bug anyone is aware of? Why can't I apply cacheAsBitmap AND a motion tween on a movieclip when using a AS2 document and Flash Player 9?

Just open attached file. While on its flash player 9 setting the circle doesn't move. Change the setting to flash player 8 and it moves again.

View 6 Replies

ActionScript 3.0 :: Disable CacheAsBitmap For Child Swf

Jul 30, 2010

I'm loading child swfs in main swf, but as default all loaded swfs has cacheAsBitmap set to true, how to set it to false from main swf? this: loadedSwf.cacheAsBitmap = false; - have no effect.

View 1 Replies

Actionscript 3 :: CacheAsBitmap Not Working On Different StageSizes?

Aug 6, 2011

I'm loading a MovieClip which pixels should be displayed perfectly.Every child of this MovieClip and the MovieClip itself uses only whole integers in position and size.The funny thing is that even if I use "myMovieClip.cacheAsBitmap = true" sometimes it will appear blurry.

View 1 Replies

ActionScript 2.0 :: CacheAsBitmap + Mask, Bizzarre Behavior?

Mar 3, 2010

In the root of my swf i have 2 mc files "menu" and "mask". Mask has inside a vector gradient, while menu is a vertical scroll-able menu, then the mask makes a fading effect on top/bottom. The code:

Code:
stop();
_root.menu_mask.cacheAsBitmap = true;
_root.menu.cacheAsBitmap = true;
_root.menu.setMask (menu_mask);

Inside the menu i have, on first frame, the code for scrolling ( and some functions cause the buttons are duplicated from info on a xml file). The code:

Code:
stop();
var yPos = -23;[code].......

The Problem: If i Scroll the buttons all way up, the mask transparency parts looks like to move right (not the whole mask, just the transparency points). If i set no transparency for the mask, this problem doesn't show up.

View 1 Replies

ActionScript 3.0 :: Set CacheAsBitmap To True On A Display Object?

Mar 15, 2010

I'm actually rendering quite a complex 3D scene (complex is a relative term here, doing a similar scene in d3d or opengl would be a breeze, but they're hardware accelerated so you'd expect that). I've built a 3D engine with some basic features including depth sorting, 3D tweening, and mapping between polar and cartesian coordinates. This last bit should be a give away as to what I'm doing - I'm rendering a 2d grid onto a sphere that I then unravel, spin around, squash, expand all so the Client goes ooh and aah. The trouble, is that on anything other than my workstation, rendering crawls. From discussions with other flash programmers and my own investigations, the slow down is most definitely caused by the rendering itself, and not my relatively swift matrix and sorting calculations (they take around 5-14ms tops depending on the complexity of the scene) .

So, my question is, what exactly does happen when I set cacheAsBitmap to true on a display object? I see no texture map distortion so I'm under the impression that flash automatically splits the cached bitmap into polygons for rendering, but how good is flash at doing this? I don't care about texture distortion on objects beyond a certain z value because they're far away, and try as I might I have found no way of setting the equivalent of a display objects 3d render quality. I'm certain that if I could set such a value, I'd at least double the render speed of my scene by only rendering many polys for objects near the camera. Failing this, is there a way to coerce flash into rendering a low poly object? Perhaps by making invisible any graphically complex children?

View 6 Replies

ActionScript 1/2 :: Nested Clips For CacheAsBitmap Using OnLoadInit

Mar 8, 2011

I'm using cacheAsBitmap to create a gradient mask. The code I set up worked great and all was well but I soon discovered problems when cacheAsBitmap was being nullified when its parent mc was loaded into another mc. I read up on it and from what I understand, since I'm using the MovieClipLoader class, this code should be included in onLoadInit in the root mc (start_mc). Basically this is what I have: start_mc loads main_mc (target) and rollMask1 and roll1 are contained within main_mc. Here's the script for onLoadInit:

[Code]...

View 50 Replies

Actionscript 3 :: Caching - Moving ScrollRect With CacheAsBitmap?

Aug 30, 2011

in order to increase performance of a scrollRect i must cache the vector as a bitmap, otherwise the scrollRect will be simply a less performant mask (info source).however, i can't seem to move an object/scrollRect once i've applied cacheAsBitmap. why?

package
{
//Imports
import flash.display.Screen;
import flash.display.Sprite;

[code].....

View 1 Replies

ActionScript 3.0 :: Additive Blend Killed By CacheAsBitmap

Aug 2, 2010

I'm a seasoned AS3 developer working on a major online project and we've run across a strange visual anomaly which is connected to the movieclip cacheAsBitmap property. When using author-time additive blends (which we use for lighting effects) in a movieclip, turning on the cacheAsBitmap property (without which performance becomes unacceptable in our very detailed art) seems to 'destroy' the additive blend. The art director says that the visual effect produced is as if the blend mode had been set to Normal, which I can confirm--some blends which are yellow turn orange, other 'spotlights' turn from transparent yellow to dark gray.

View 5 Replies

ActionScript 3.0 :: AIR More On Getting Filters To Work On IPhone (cacheAsBitmap?)

Dec 25, 2011

The cacheAsBitmap property is somewhat similar to what I had to do to get the filters to show up on iPhone GPU mode:But I played around with that property yet filters still don't show up.I even tried to put child objects (with filters) inside a parent object (no filters but cacheAsBitmap = true), no shows.

View 1 Replies

ActionScript 2.0 :: Fast Color-transformation Over MovieClip With CacheAsBitmap?

Jun 3, 2009

I have a very complex vector symbol on the Stage - background_mc. I have set background_mc.cacheAsBitmap = true.This turns background to bitmap and makes Stage repaint fast.Every frame the background light changes.I use the following code to alter the light.

(new Color(background_mc)).setTransform(light);

And here is the problem.The code works very slow.I guess because the light is applied to the contents of the background_mc.And then a new cached bitmap is resterized once again.The same code over BitmapData of the same size works much faster!Is there a way to tell Flash to apply color-transformation to the cached bitmap, instead of underlying vector symbols?

Note, that background_mc is scaled when Stage is resized.This is not so fast, but it's good, because the picture quality preserved.If I convert background_mc to BitmapData, bitmap would be scaled.

View 1 Replies

Professional :: Does CacheAsBitmap Helps For Performance Of Shape Tweens

Aug 2, 2010

I have an image converted into MovieClip (background) and I have a mask MovieClip (bgMask) set to mask the image MovieClip like this:

[Code]....
 
In bgMask I have a few linear gradient shapes which I animate with shape tweens using keyframes. If I don't set cacheAsBitmap for both, nothing will happen since what I need is alpha masking and it will work only then. In this scenario is cacheAsBitmap working for me or agains me? (not that I have any choice). Still I could try to replace some of the shape tweens with MovieClips with solid shape in them and just move them around to uncover some part of the background, and where I want a smoother transition I would stick to the shape tweens. If the object that I've set cacheAsBitmap true to is no longer being animated moved sized and so on, would it be better to set cacheAsBitmap to it to false?

[Code]....

View 1 Replies

ActionScript 3.0 :: Turn On CacheAsBitmap Inside Class That Extends Movieclip?

Nov 15, 2010

I've recently started using the cache as bitmap switch on my on-stage movieclips, to great success, while creating my isometric RPG. What I can't grasp though, is how to apply it to AS-instantiated classes/object.How can I turn on cacheAsBitmap inside a class that extends movieclip? Alternatively, how can I do it from outside the class, from another class that adds mentioned movieclip to the stage?

View 1 Replies

ActionScript 2.0 :: Gradual Memory Leak - CacheAsBitmap & Filters Array Culprits?

Jul 12, 2009

My webapp progressively slows down over 45 min of use. People will be using it for longer, and it needs maintain its snappiness.I'm making sure to dump() any Bitmaps I use and of course clear any intervals that are running, but for some reason there's a buildup over time, and only restarting the browser clears up the lag, for example, when the user is entering text.I'm going to go ahead that it's an error in how I'm building things and not a Flash memory leak

Question 1: I read somewhere that every time that I "cacheAsBitmap," the movieclip must explicitly be set to cacheAsBitmap = false, or else the memory won't be freed up, in the same way that Bitmaps must be dump()ed to free up memory.I'm assuming I need to only do this for MCs that I cacheAsBitmap by code, and not through the GUI. Do I need set cacheAsBitmap = false via code even for MovieClips that I check off with "use runtime bitmap caching" through the Flash GUI?

Question 2: When I have added filters (like a DropShadowFilter) to the filter array of a movieClip, do I need to do anything to free up that memory, such as delete the references to the filters, or set filters to a blank array, before the MovieClip is removed... or is this done automatically? I have been assuming that it is handled by flash, but this could be a HORRIBLE assumption.

Flash 8 compiled ActionScript AS2 ... combination of Classes and FLA embedded code

View 2 Replies

ActionScript 3.0 :: Writing Directly Into Bitmapdata Cause Flash To Refresh Bitmap In Case Of CacheAsBitmap

Dec 26, 2011

So if i have a bitmap in a mc that doesnt animate (because i write directly into the bitmapdata) can i use CACHEASBITMAP?

View 3 Replies

ActionScript 3.0 :: Access The Newly Created Bitmap Data To Access The Method CacheAsBitmap.bitmapdata.dispose() ?

Oct 22, 2010

So, you have a sprite, you draw some graphics, you set cacheasbitmap=true... I can't seem to access the newly created bitmap data, to access the dispose() method.

[Code]...

View 6 Replies

ActionScript 2.0 :: Convert A Mc To A Bitmap With "cacheAsBitmap"

Feb 26, 2008

I know I can convert a mc to a bitmap with "cacheAsBitmap".Now I am wondering how I can convert a bitmap to a mc.I have a black and white bitmap, which I created from a vide still.now I would like to convert the white area of this bit map to an mc,so that I can used it for hitTest etc.

View 1 Replies

ActionScript 3.0 :: How To Use Internal Css

Feb 25, 2010

i found plenty of tutorials and posts on loading and using external stylesheet, but i find it slows down my app for no reason, im only using 2 styles. i was using an internal css in as2 but cant get it working in as3. how to use internal css in as3?

View 5 Replies

ActionScript 2.0 :: Loading An Internal Mc Into An Empty Mc?

Sep 10, 2009

I have a button that each time it's being press, it will load a mc that's located in the library.
The movie clip is text that's located in a mc, that i can fade in the text when the parent mc is called (meaning, text in a mc in a mc).

How can I do this actrion, where each time the button is pressed the mc will load? tried a few things such as loadmovie, attachmovie, but some how it doesn't work for me.

I gave my parent mc an instant and tried with the butoon calling it. didn't work.

View 7 Replies

Unable To Create Internal Links On Xml

Mar 24, 2010

Ive been sitting infront of this screen trying to create an internal link to my contact page from some text i have on my about us page.[url]...

View 1 Replies

ActionScript 3.0 :: Use An Internal Sound Instead Of A UrlReq?

Nov 3, 2009

heres what i have

public var sampleMP3:Sound;
sampleMP3 = new Sound();[url]....

i want to use an internal sound instead of a urlReq.how do i do this? its in the library with export for actionscript selected and has a class name testmp3?

View 1 Replies

ActionScript 3.0 :: Load Photos From Internal XML?

Dec 11, 2010

I have this photo gallery I'm trying to make using internal XML, but I'm having a lot of issues getting it to work.

Here is a snippet of my code:

//var fm_tween:Tween;
var total:Number;
var photos_xml:XML = <thumbnails>

[Code].....

View 28 Replies







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