ActionScript 3.0 :: Masking Out Off-stage Content Of Loaded .swf?

Aug 28, 2009

I'm just starting out with AS3 and this is what I'm trying to do:

1. I have an external .swf banner which is 900x250 pixels

2. I want to load this .swf into my main project, using this code:

var myLoader:Loader = new Loader();
addChild(myLoader);
var myRequest:URLRequest = new URLRequest("ptp.swf");
myLoader.load(myRequest);

3. The problem is that the .swf banner that is being loaded has content 'outside the stage' so instead of just showing the 900x250 area I see all the off-stage content as well.

How do I 'mask out' the off-stage content of the loaded .swf so that it will be only the 900x250 that I want?

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Drag Dynamically Loaded Content Beyond Stage Borders

Jul 28, 2010

I have simple file 550 x 450, in it there is one container 400x300, x:75, y:78. In the container I am loading images and there is drag and drop function for them. I also have added mask with size that matches the size of the container because when i load larger images i could move them. Everything is working fine, but If I set scaleX and scaleY to the container image, the drag and drop functionality is not working fine - I can't reach the edges of the picture.

Code:
with ( m_mask.graphics )
{
beginFill( 0x000000 );

[Code].....

It behaves like there is not enough space to move the image right, left, top or down.

View 1 Replies

Actionscript 3 :: Make The Actual Stage Dynamic To The Content Loaded In The Flash File?

Nov 9, 2011

I was wondering if there is a way to make the actual stage dynamic to the content loaded in the flash file.

Firstly the method I am using is importing a external swf to the stage into a container called container. The main stage, lets call it index, is still on default size, and I want this to expand dynamically as content is loaded in. page1 may be 900px width, page2 may be 500px width, and as I load the content the index stage should expand the width to that of the page loaded. Some steps I have tried but did not work.

if page1 button is pressed stage.stageHeight = 900; - not working (how do I set stage size in as3)made a movieclip in page 1 spanning the page size and called it p1_stage so I can reference the data from there. trace(container.p1_stage.height); gives this error: TypeError: Error #1010: A term is undefined and has no properties. at index_fla::MainTimeline/frame1()

View 3 Replies

ActionScript 3.0 :: Masking Dynamic Content?

Feb 3, 2009

I'm loading images into an otherwise empty MovieClip called container_mc using UILoaders and spacing them horizontally. I also have the image names as TextFields below the images all within the container. I'm masking the container clip using the following syntax:

container_mc.cacheAsBitmap = true;
mask_mc.cacheAsBitmap = true;
container_mc.mask = mask_mc;

This USUALLY works, but for some reason when I load over 20 images into the container -- the mask no longer works. At first it appears as though it's working but then the text disappears and when I mouse over the images to scroll them horizontally, the mask (which is magenta) appears and disappears -- flickering strangely. Should I be caching? I was under the impression I had to for the dynamic text to show up. Maybe it's the where I placed the code (load-order)?

View 0 Replies

ActionScript 2.0 :: Masking The Interactive Content?

Oct 10, 2006

I have tiled map made of dots. Each dot is interactive.In order to facilitate smooth scrolling over the map I want to be able to mask it as you would a regular image, then drag the masking window to reveal new areas.

The problem I have is that the mask only hides whether you can SEE the underlying map. So, when the cursor is outside 'visible' map area it's still interacting with the hidden portion of the map.

View 3 Replies

ActionScript 3.0 :: Masking + Dynamically Generated Content?

Jan 16, 2011

I've got an object in the library that's a basic rectangle with an outline. A for loop creates a grid dynamically. I want to create a mask that goes over this grid. I'm using "my_object.mask = my_mask", but to no avail

View 1 Replies

ActionScript 3.0 :: Masking Some Dynamic Content That Is Brought In Through An External Swf?

Mar 25, 2009

it is masking some dynamic content that is brought in through an external swf. there is a dynamic text field and also a picture loader. whenever either one of these changes, the mask gets all distorted with holes/lighter areas in it.

View 1 Replies

ActionScript 3.0 :: Masking External Loaded Image?

May 24, 2009

I'm loading an external image to use as part of the background for each section (other section, new external image). But that image needs to be animated in, in a certain shape (I have created a kind of spatter animation).I always use an Movieclip container to place my external images. So on one layer I have this container clip. I mask this layer with a layer on top of that one, which has the splatter animation (this splatter animation is not a movieclip, just some keyframes with the animation).Everything works, except that the image is not loaded. I checked everything, maybe I put the wrong url or something. But nothing.

So I tried unchecking the mask option. Ok... now my image did load. But as soon as I check the masking of that layer, again I'm left without image.It seems to me that it has problems with loading images that are begin masked. How can I fix this? I tried google'ing, but few solutions were found. And I'm nog programer-guru. I use flash semi-design/semi-program.

View 2 Replies

ActionScript 3.0 :: Masking Lost When Images Loaded

Apr 16, 2010

I have a Sprite name - thumbnailContainer which consist of following Sprites :
maskSprite @ level2
thumbnailPane @ level1
thumbnailBg @ leve0

The thing is that, I have masked the thumbnailPane with maskSprite. The issues is, whenever the external images are loaded into the thumnailPane, the mask is lost - revealing the entire horizontal stripe of the thumbnails. As well as the thumbnailBg in thumbnailContainer gets blurred even though, I have not applied any kind of filters on any sprite ! I am using TweenLite for transitions.

View 2 Replies

ActionScript 3.0 :: Masking Dynamically Loaded Images With Movieclip?

Dec 10, 2011

I wonder whether anyone could give me an idea of where I am going wrong with this.I am loading images into a sliding menu which will act as a thumbnail viewer, the structure of which is: "thumbsContainer" (movieclip) nested inside "galleryPane" (movieclip). The images are loaded into movieclips named "all_thumbs", which are added to the thumbsContainer stage.

I would like to mask the content of the thumbsContainer, so that only the images physically within the thumbsContainer border will be viewable. I have tried adding my coded mask to the thumbsContainer stage, and tying it to the thumbsContainer; and have separately tried the same with the all_thumbs movieclip - but no matter how I organise my code, I can't get this to work. If the mask is tied to the thumbsContainer mc - that element disappears; if the mask is tied to the all_thumbs mc, only the background to the thumbsContainer is visible. Either way, I cannot get thumbnails to display through the mask. No thumbnails at all will display on stage.

I've had a good look through the books I have and online, but with no joy so far.

I'd be really grateful if someone could give me a steer with this.

[Code]...

View 6 Replies

ActionScript 3.0 :: Remove The Loader But Its Content Still Playing I Know That From The Sound Of The Content Was Loaded?

Apr 20, 2009

How to remove a loader and its content using removeChild or any other way, I had removed the loader but its content still playing in the background i know that from the sound of the content.this is the my code for removing:

removeChild(getChildByName("SampleLoader"));

View 9 Replies

ActionScript 3.0 :: Flash Masking Dynamically Loaded Images Within A Movieclip

Dec 10, 2011

I am loading images into a sliding menu which will act as a thumbnail viewer, the structure of which is: "thumbsContainer" (movieclip) nested inside "galleryPane" (movieclip). The images are loaded into movieclips named "all_thumbs", which are added to the thumbsContainer stage.

I would like to mask the content of the thumbsContainer, so that only the images physically within the thumbsContainer border will be viewable.

I have tried adding my coded mask to the thumbsContainer stage, and tying it to the thumbsContainer; and have separately tried the same with the all_thumbs movieclip - but no matter how I organise my code, I can't get this to work. If the mask is tied to the thumbsContainer mc - that element disappears; if the mask is tied to the all_thumbs mc, only the background to the thumbsContainer is visible. Either way, I cannot get thumbnails to display through the mask. No thumbnails at all will display on stage.

Code:

all_thumbs.addChildAt( thumbLoader, 0 );
c = c + 1;
if ( c < totalPics ) {
all_thumbs.alpha = 0;

[Code]....

View 3 Replies

ActionScript 2.0 :: FMX Masking - Attach A Movie Clip On Stage?

Dec 31, 2002

ok so heres the problem: i have some buttons that are suppose to attach a movie clip on stage after you press it. This works perfectly, but after i mask it, the masking box blocks it so i can't click on anything.

i hope you understood what i'm saying, and i've tried using the 'setmask' code, but that doesn't work either.

View 11 Replies

ActionScript 2.0 :: Align Clip On Stage That Has Wide Masking?

Apr 6, 2006

Is there a way to say "only use the coords of the viewable area" when aligning a mc that is masking a really wide object? (I'm looping through XML and duplicating MC's inside a centered mc and under a mask.)

View 7 Replies

ActionScript 2.0 :: Loading External SWF And Masking Stage.width

Aug 10, 2006

I am loading a swf into another swf. The swf I am loading has objects off the stage, and when i load the swf into the other it shows the objects off the stage and screws up my positioning logic. Is there any way to load the swf and hide all the objects that arent on the stage?

View 1 Replies

ActionScript 2.0 :: Preloading Flashvars - Ensure That All The Content Being Loaded Externally Is Loaded Before The Transition Plays?

Aug 30, 2005

I am in the process of building a site for an Architect... Jamie Fobert Architects (projects) I am useing transitions between the projects and am loading details/text and images externally through flashvars, php and a mySQL database. Within my transitions I have a a preloader on the forst 2 frames the code is as follows (taken from a Voetsjoeba tutorial):

[Code]....

This works pretty well if the content is within the .swf, but when it is loaded externally it doesnt preload it at all. Does anyone know how I can adapt/improve this preloader? or somehow ensure that all the content being loaded externally is loaded before the transition plays?

View 2 Replies

ActionScript 3.0 :: Accessing Stage Items, Through A SWF File Which Is Loaded Inside The Stage

May 14, 2011

- I have A.fla.

-  A.fla includes buttons, movie clips and also B.swf is loaded in A.fla using a LOADER

- i want to access elements in A.fla, from the actionscript codes inside B.fla to modify those movie clips and buttons based on actions going on in B.swf
 
for instance, lets say there is a button X in A.fla, and there is a button Y in B.fla,  B.swf is loaded into A.fla, and I want the button Y to erase button X when clicked.
 
general question:  accessing elements in a stage, through a SWF file loaded into that stage.

View 2 Replies

ActionScript 2.0 :: External MC Loaded On Stage - Can Press Buttons That Are On The Stage Through It

Sep 26, 2008

An external swf is loaded using this code...

[Code]...

The problem is that even though this external movie covers the whole stage, My mouse can still "see" buttons that are on the stage, and I can click them. I don't want to be able to click the buttons through my external movie.

View 2 Replies

ActionScript 3.0 :: Load The .swf With The Exact Stage Size So The Graphic Elements Do Not Float Outside The Loaded Movies Stage Area?

Sep 7, 2010

I'm making a mockup for a client and I need to Load the .swf with the exact stage size so the graphic elements do not float outside the loaded movies stage area. [URL]Basic load code I'm using...

Actionscript Code:
import flash.display.*;var adLoader1:Loader = new Loader();adLoader1.load(new URLRequest("100828_budlight_texas_fight_728x90_jn.swf"));adLoader1.x = 313;adLoader1.y = 162;addChild(adLoader1);var adLoader3:Loader = new Loader();adLoader3.load(new URLRequest("100828_budlight_texas_fight_300x615_jn.swf"));adLoader3.x = 738;adLoader3.y = 0;addChild(adLoader3);

View 3 Replies

ActionScript 3.0 :: Get Dimensions Of Loaded Content?

Aug 30, 2009

How can i get the dimensions of the loaded content of a Loader object?[code]...

View 8 Replies

ActionScript 3.0 :: External Swf Could Not Use Loaded Content

Aug 23, 2010

I have main preloader that loading external swf into it. external swf call method load picture from url. when event complete picture does not appear. but if external swf is the main swf it will appear nomally. I tried to use init but it still not working When I debug loader.contentLoaderInfo.content that call from external is gone.

View 1 Replies

ActionScript 2.0 :: Centering Loaded Content?

Oct 28, 2005

I have an index.swf that it's dimensions are 1020x610, now when I load content in a container in the index.swf it will be centered using an onResize stage listener, that works fine but only if the loaded content is 1020x610, I've also used an onEnterFrame that checks if the width and height are !=0 so that way it waits for it to load before centering the content.

What should I do to always keep my content centered. Lets say I want to load a swf that is smaller (ie the 1st frame only contains 1 element that is smaller than the stage dimensions) I'm not sure if I'm explaining this well....

View 6 Replies

ActionScript 3.0 :: Merging Loaded SWF Content?

Jan 6, 2009

I am trying to merge loaded SWF content into one centralized data placeholder. The SWFs will be loaded through a Loader class. From what I know, as soon as the Loader class dispatches Event.COMPLETE, I can have access to the SWF content. What I am trying to merge here are the classes in the SWFs.

Why I need this is because, I am building a game where the character will have equipments for different body parts. Let say the head, body, bottom. I will load Head.swf, Body.Swf, Bottom.swf. After fully loaded, I will access the assets through standardized classNames (e.g. HeadPart1, HeadPart2 using getDefinitionByName(className)).

I can do this if I am getting the content from each individual Loader object - loader.contentLoaderInfo.applicationDomain.getDefi nition(className) but I am guessing if I have many other body parts, I will need more Loader objects.

So I am wondering if there is a way where I can grab all the loaded content from a loaded Loader into a data placeholder? I foresee there might be naming conflicts if I try to merge a Head2.swf inside the data placeholder after Head.swf as they both have parts with same class names. Will there be a way to overwrite an existing asset with same class name?

View 3 Replies

ActionScript 3.0 :: Accessing Loaded Swf Content?

Mar 30, 2010

I'm loading swf file from a server. For some reason i can't access movieclips that are not instantiated on the first frame, more than this - all movieclips that are not instantiated on the first frame and have some animation inside of them, won't stop looping, like there is no stop() action inside, but it is there. And even more than this - everything works fine when i'm using other server. Both servers have crossdomain.xml file that looks the sameI don't get no crossdomain errors and no other warnings.

View 2 Replies

ActionScript 3.0 :: Set UILoader Loaded Content To Position Top?

Nov 25, 2010

I have UILoader that loads images 427x240, then I thought to load an external swf dimensions 427x273. So I resized UILoader to height 273, now the images on load are positioned vertical middle, gap top and bottom, i need this to be absolute Top. How do I set UILoader loaded content to position Top?

View 2 Replies

ActionScript 3.0 :: Scrollbar And Loaded Content Of Various Sizes?

Jun 5, 2009

I'm working on a project that uses a loader to load up a swf, then display the loader in an area using a mask and a scrollbar to scroll through the content. The content in this project will change regularly, including the dimensions of the swf file (vertical dimension only, I'm not worried about horizontal scrollbars with this question).The problem I'm running into is I can't figure out a proper formula to get the scrollbar to position the content at it's bottom when the scrollbar is at the bottom  What I have now is close, but not exact. If you scoll to the bottom, the bottom of the content would scroll up too high, leaving an empty 'blank' space where the content should be. I have an if statement checking for this currently, but this creates a 'dead zone' at the bottom of the scroll bar where the content is already at the bottom, and the scroll bar can continue to scroll down a bit.oes anyone know what I'm doing wrong here in the math to get a good scrolling going, regardless of the size of the content loaded by the loader?Here is what I have so far:

package {  import flash.display.MovieClip; import flash.net.URLRequest;  import flash.events.*; import flash.display.Loader;  import fl.controls.UIScrollBar; import fl.controls.ScrollBar; import

[code].....

View 1 Replies

ActionScript 1/2 :: Get Content Of Dynamically Loaded Movieclip

Nov 18, 2009

After trying to no avail to get the totalframes of a dynamically loaded .swf in AS3 I've regressed to AS2.
 
Now I can add the clip and get the totalframes of the content, no problem.
 
THe problem is I cannot resize the content at all.I have no idea how to target the loaded content.
 
Here's the code I'm using:
var myXML:XML = new XML();
var path:String;

[Code]....

I need to resize the content both for the main holder_mc as well as for the menu elements.

View 5 Replies

ActionScript 3.0 :: Adding Content To A Loaded Movie

Jun 10, 2011

I've got an application which loads anexternal swf, then needs to add content to a specific depth in it. It does this by finding a named placeholder clip and replacing it with a UIComponent, using addChildAt(); This seems to work fine - I have a trace utility that walks back up the display list and it shows my UIComponent right where I expect it, then the parent movie clip, then all the containers up to the stage. At each level the container is a) visible b) 1.0 alpha and c) the size I expect it to be, and from my trace I can see that I have a structure which looks something like this:[code]

All well and good, but if I draw a rectangle on the graphics of the UIComponent (or add an image to it, or do anything else), nothing is visible. I can trace any parameters of the UIComponent, I can use it to make changes to its parent SWF, I can even note that if I draw a rectangle on the UIComponent which is larger than the Loaded SWF, then the SWF changes size to accommodate the new bounds - but I can't see a thing.I was wondering if some security stopped the parent application adding content to the Loaded SWF, or if there was some other issue.

View 1 Replies

ActionScript 3.0 :: Button Not Working Under Loaded Content?

Aug 28, 2011

Plain and simple, I have a button that does not work if it exists on a layer below a loaded SWF. If I drag the button layer up above the layer where the eternal SWF is loading into and publish, the button works fine, yet if the button is below the layer that the clip is loading into it does not work at all, even when no content appears over the button. There is no button at all in the loaded clip that would interfere...

View 5 Replies

ActionScript 2.0 :: Preloader Is Not Displayed Until 90% Of Content Is Loaded

Jun 2, 2010

I've spent hours looking for a solution to why my preloader is not working. No luck. I've found alot of information, and have checked everything I can think of, but I am missing something.

Problem: Preloader is not displayed until 90% of content is loaded.[code]...

Most of the content is created dynamically, so I've had to embed one font type, but I've deselected the Export on Frame 1 option for this font. I still think this might be the issue though.

View 9 Replies







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