ActionScript 3.0 :: Bitmap Limits With ScrollRect In 3D?

Oct 19, 2009

If we have a Bitamp with more than 16777216 pixels (or one side larger than 8191 px) Flash 10 doesn't show it (Flash 9 and earlier has smaller limits even).One solution to this is to use scrollRect to limit the size displayed.OK, that works.

But Flash 10 has another problem, if we use any 3D property (rotationX, z, etc), flash transforms your MC in bitmap, so we can reach the above limit even when we are not working with bitmaps...A bigger problem is that although our MC could be really small (at least less than 16777216 pixels), when we apply a 3D transform like rotationX, the displayed MC can grows enough to reach the limit. And... we can't use scrollRect with 3D MC. But we have a trick here too, there are two ways to use scrollRect with 3D:

1. Create a 2D parent, then create the 3D displayObject inside of that parent.
2. Set cacheAsBitmap to true for the 2D parent.
3. Create a grandparent container to hold the first two items.
4. Set cacheAsBitmap to true for the grandparent container.
5. Apply scrollRect to the grandparent container.

These methods are really differents, with the second I couldn't use scrollRect to avoid reaching the bitmap limit. I think that's because in the second we apply scrollRect to the parent and 3D to the child, so nothing breakes our child from growing.With the firs method we apply scrollRect to the child, and the 3D property to the parent.

Code:
var p: Sprite = new Sprite();
var c: Sprite = new Sprite();
p.addChild(c);

[code]....

View 0 Replies


Similar Posts:


Actionscript 3 :: What Are The Actual Limits Of A Bitmap In Flash

Nov 18, 2010

As I can read it from this article the maximum square bitmap Flash can handle is 4,095 x 4,095 (which results in 16,769,025 pixels and bla-bla-bla). So, they say if I try to go to 4,096 x 4,096, I'll fail. But I have tried to load and display a bitmap image sized 4,096 x 4,096, and it worked well. Then, I even tried an image sized 5000 x 5000, and that was alright too. What do I not understand? What are the actual limits and how to calculate them?

View 2 Replies

ActionScript 1/2 :: ScrollRect Without Rectangle Class

Feb 22, 2010

Is it possible to use scrollRect without the flash.geom.Rectangle class?I know the scrollRect can be used like this:import flash.geom.Rectangle; myMC.scrollRect = new Rectangle(10,10,100,100);I need to make a flash which doesn't extends outside the stage (bacause loading it from another flash will expose anything outside the stage area). Using a mask is an option, but scrollRect seems very interesting because it would be easier and give greater performance.But I can not import the flash.geom.Rectangle class (and it seems overkill to import a class just to set x,y,width and height)How can use scrollRect without the flash.geom.Rectangle class?

View 3 Replies

ActionScript 3.0 :: Move A ScrollRect Up And Down Using The Mousewheel?

Aug 11, 2009

I'm trying to move a scrollRect up and down using the mousewheel. that part i've got fine but now i wanted to add easing and am not sure on the maths..

ActionScript Code:
function handleMouseWheel(event:MouseEvent):void {
var rect:Rectangle = this.scrollRect;
var scrollSpeed:int = 10;

[code]....

View 0 Replies

ActionScript 3.0 :: Object Moves With Scrollrect?

Aug 18, 2011

I have a scrolling background that is 1320 x 1000 big. I'm using a sprite as a container where my background canvas is placed inside of it. Additionally I add (via addChild) a score sprite inside of the background sprite (the one that holds the bg canvas so the score appears on top of the bg canvas).The goal is that when I add a score it shall be stuck to the background (even when the scrollrect moves; it shall have a fixed position on the background).The problem is that this doesn't work because when the score appears it moves with the scrollrect and this is not what I want. I already tried it with globalToLocal but had no success yet. Probably because I don't really understand globalToLocal (and vice versa)These are some code excerpts:

Code:
private var backgroundBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0x000000);
private var canvasBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0x000000);

[code].....

View 7 Replies

ActionScript 2.0 :: Scrolling ScrollRect With A ScrollBar?

Jun 5, 2008

I have some actionscript, and it scrolls the scrollRect, but there is a catch. It doesn't completely scroll it. It lets me scroll down until it's halfway and stops. I can still scroll up to the top, but the problem is unerving. I can't find a fix for it.

[Code]...

View 2 Replies

ActionScript 3.0 :: Scrollrect Vs. Mask: Smooth Movement?

Jan 27, 2009

There are two basic ways of panning a view in Flash. One is to move the display object (and use a mask if necessary). The other is to use scrollrect. Today I noticed a small, but annoying effect of scrollrect. Scrollrect's can't have true Numeric positions-- they are automatically snapped to the nearest pixel.

When moving at very slow speeds, the effect is noticeable. In this example you can switch between two modes of panning, sprite movement with mask and scrollrect:

http://lab.wx3.com/scrolltest/ (view source enabled).

In the default mode, the circles move smoothly.

In scrollrect mode, the circles seem to stutter because the scrollrect is snapping to the nearest pixel.found a way to make a scrollrect move smoothly at slow speeds?

View 3 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 2.0 :: ScrollRect - Unable To Upload A File?

Jun 19, 2009

I am having a problem with ScrollRect. I am unable to upload a file( i don't know why..i am getting upload error msgs). So i have quoted the code.

ActionScript Code: import flash.geom.Rectangle;   
var container:MovieClip = container_mc;//container_mc is in timeline(its widht is 600 )
var window:Rectangle = new Rectangle(0, 0 , 400, 100);
container.scrollRect = window;   
container.cacheAsBitmap = true;

[Code]...

Currently the leftmost part of movieclip is visible. I want to make right most part of movieclip to be visible at first. What should i do ?

View 2 Replies

ActionScript 3.0 :: Redraw Invalidation With ScrollRect Vs GetBounds?

Mar 24, 2011

I'm having a problem that involves scrollRect and getBounds. In short, getBounds is reporting an old value not accounting for scrollRect changes during that frame. Example:

ActionScript Code:
var shape:Shape = new Shape();
shape.graphics.beginFill(0);

[code].....

View 3 Replies

ActionScript 2.0 :: HitTest On Mc Doesn't Work With ScrollRect?

Oct 29, 2006

I have two pieces of code, that won't work together.First: this makes a hitTest on an mc to make it run on rollover:

Code:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (this._currentframe<this._totalframes) {
nextFrame();

[Code]...

Each work seperately, but they won't together. How do I get around this?

View 7 Replies

IDE :: ScrollRect Causes Motion Tween On Timeline To Stop?

Jul 1, 2009

I'm having trouble using a scrollRect on an object instance on the timeline that has a motion tween. As soon as I apply the scrollRect to it, the object just stops! I've attached a simple fla that shows what I'm talking about.

Simply comment out this line in the first frame's actions to see the oval move across:

Code:
oval1.scrollRect = window;

The actual application I'm making is using a scrollRect on a custom list control, where each item in the list is a symbol in the library. It works great, except if I try to move my list around using a motion tween (the list still works, but the list doesn't move in the motion tween). As soon as I remove the code to apply the scrollRect, it works but the list fills the screen!

View 1 Replies

ActionScript 3.0 :: Flash Object Moves With Scrollrect?

Aug 18, 2011

I have a scrolling background that is 1320 x 1000 big. I'm using a sprite as a container where my background canvas is placed inside of it. Additionally I add (via addChild) a score sprite inside of the background sprite (the one that holds the bg canvas so the score appears on top of the bg canvas).

The goal is that when I add a score it shall be stuck to the background (even when the scrollrect moves; it shall have a fixed position on the background).

The problem is that this doesn't work because when the score appears it moves with the scrollrect and this is not what I want. I already tried it with globalToLocal but had no success yet. Probably because I don't really understand globalToLocal (and vice versa).

These are some code excerpts:

Code:
private var backgroundBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0x000000);
private var canvasBitmapData:BitmapData = new BitmapData(1320, 1000, false,

[Code].....

View 1 Replies

ActionScript 2.0 :: ScrollRect And Browser Resizing - Panning Doesn't Go With It

May 28, 2008

I'm trying to make a full browser webpage that utilizes the scrollRect type of class to pan around a movieclip that contains other movieclips and so on. The problem I run into is that when the browser window is resized that panning doesn't go with it. So panning to all the edges becomes impossible. I've tried a bunch of different stage resizing techniques but none of them give any good results. Here's the actionscript I'm currently working with:

[Code]....

View 4 Replies

ActionScript 3.0 :: FP 9: Fullbrowser Images Transition From Left To Right Using Scrollrect LAGS?

Mar 11, 2009

hi guys, basically quick rundown is:

1. container1-->bitmap image with bitmapData.
2. container2-->bitmap image with bitmapdata.
3. im using the latest tweenmax
4. have correctly added a 2 seperate scrollrects to container1 and container2 that takes the width and height of the stage.
5. tweenmax is only moving the rectangles.

I get the effect i want, however, it still lags a choppy animation. Anyone know how come?

View 3 Replies

Pasteboard Expansion Has Limits In CS3?

May 28, 2007

I'm using a very wide object in Flash CS3, and I didn't have a problem with the pasteboard automatically expanding to contain it in Flash 8 Pro, but apparently CS3 has limits as to how far it'll let the pasteboard expand, -2880 px to 3620 px or thereabouts. This means I have to move my object off of x:0 y:0 to work with it. This won't kill me, but it does seem to be a step down from Flash 8. Anyone have any news on why this change was made, and if there's any way to correct it?

View 4 Replies

Mc Following Mouse But Within Limits And Smoothly

Nov 30, 2009

I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.

View 1 Replies

ActionScript 3.0 :: How To Make Limits

Jul 21, 2010

1)i dont know how to make limits! ... and what i mean by that ... for example ... how to make a car unable to move on the buildings ?or how to make the a car dont fall out of the screen ?

2) i also need something ? .. what is the function that could make the screen Zoom In , or Zoom out ??

3) also i wants to know ... how to make the screen Move like to make a car in the middle of the screen and moves as it moves ?

View 5 Replies

ActionScript 2.0 :: Stretching Outside The Limits

Sep 30, 2004

ive seen in a few places were pressing a button drops down a menu, which extends outside the size of the flash movie. So that it goes over whatever text is actually underneath the movie. Ive tried to do the same by just making the menu go below the movie, but that just gets cut off

View 8 Replies

ActionScript 2.0 :: Center A Mc With Limits?

Jun 18, 2007

I created a hit test for stop a mc on the top of the stage.

It 's blocking all right, but i need that when is blocked then align on the center again.[code]...

View 2 Replies

ActionScript 2.0 :: Stretching Outside The Limits?

Sep 30, 2004

ive seen in a few places were pressing a button drops down a menu, which extends outside the size of the flash movie. So that it goes over whatever text is actually underneath the movie. Ive tried to do the same by just making the menu go below the movie, but that just gets cut off

View 7 Replies

ActionScript 3.0 :: Mc Following Mouse But Within Limits And Smoothly?

Nov 30, 2009

I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.

View 2 Replies

ActionScript 3.0 :: MC Following Mouse But Within Limits And Smoothly

Nov 30, 2009

I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.

View 1 Replies

ActionScript 2.0 :: Map Pan, Setting Limits To Image?

Dec 3, 2006

hey I have a large map in an mc and navigation buttons to control the map.

2 questions:

1.Does anyone know how to set limits on this? my image is w2200 h2980? stage is 1000w x 740h I am using code like this? Th buttons are either 1 or a 0 so i think the limit function needs to be in this section.

2. does anyone know how to adjust the script for zoom so that the image will zoom in n out without refocusing on a specific point. my large map move to a specific location as it zooms. it would be cooler if the the map zoomed in and out based on current location.

[Code]...

View 2 Replies

ActionScript 2.0 :: Recursive Limits Workaround?

May 11, 2007

I am making a SUDOKU generator(ActionScript2.0), which would (for now) generate the full and correct sudoku table. To do that I need to use recursive functions for calculating all the possible values. The problem is that when I try to run my program I get this error :

Code:

256 levels of recursion were exceeded in one action list.

This is probably an infinite loop.

Further execution of actions has been disabled in this movie.Is it possible to somehow work around this limitation?

View 2 Replies

ActionScript 2.0 :: HTML In Flash Limits?

Apr 5, 2008

was trying to add <div> tag to flash TB. but it doesnt render it,i use htmlText ...

View 8 Replies

ActionScript 2.0 :: (CS4) Stargdrag Multiple Drag Limits?

Oct 9, 2009

Im using the code below to stop a page being moved past certain points when at 25% zoom on my page. This works perfectly however I have 50%, 75% and 100% zoom aswell. How would I alter this code so the drag limits can be different for each level of zoom.The code im using just now is:

pages.onMouseDown = function () {
// check if page is zoomed
if (pages._xscale != 25) {

[code]....

View 4 Replies

Media Server :: Setting Connection Limits?

Aug 14, 2009

I have multiple applications, and need to set different connection limits for each of them - e.g., 10, 35, etc.I'm only concerned with limiting RTMP connections, and not using Apache or http streaming.

View 3 Replies

ActionScript 3.0 :: Dividing An Amount Evenly Within Limits

Dec 14, 2009

I often need to divide quantities in recipes. Normally, this is straightforward: I have an array of items to divide and a total, so I can do something like

[Code]...

However, this time I have been handed a curve ball: some of the items have a maximum amount they can be. For example, item A has a maximum amount of .25, item B is maximum of 1, the other items have no limits. So if the total amount is 3, and I am dividing it by 3 items I can't simply set each one's amount to 1 (as I normally would, as the code above does). I need to set the amount of A to .25 so there is still the .75 "left over" that I now need to apply evenly to the remaining items.

So that means the other 2 items B and C would be 1.375 each -- but, as I said above B also has a limit (of 1), so B would be 1 and C (no limits) would get the whole .75 remainder, and be 1.75. So A=.25, B= 1, C=1.75 for the total of 3. My question is, even conceptually, how would I approach a problem such as this in AS?

[Code]....

View 1 Replies

Professional :: Extend Memory Limits In Flash?

Mar 29, 2010

I'm been working on a large-scale Flash game for the past 13 months, and a few months ago I was encountering an error message when trying to export saying, "Error creating Flash movie. There was not enough memory available." Here is a screenshot <url...> This isn't due to large videos or photos in the file, it's because theres a huge amount of frame by frame animation, so I can't just reduce quality.

I was off of a crappy laptop so at first I just bought a new computer with tons of ram because I didn't realize the software was an issue. This did not change anything (though I can run flash with less lag).
 
Then, I decided to do as much optimizing as I could. After a few months, all opimization possible as been done, and I have reached the point where I get the error again.
 
Then, I decided to cut the main file up into smaller pieces and link them together. This worked, but now some individual pieces require too much memory and get the error.

View 5 Replies







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