ActionScript 3.0 :: Resize The Avm1 After Loaded Into The Avm2
Dec 6, 2010i got a avm2 shell to load the avm1 swf.
but after loaded, i don't know how to resize the avm1 to fit the avm2 W&H.....
i got a avm2 shell to load the avm1 swf.
but after loaded, i don't know how to resize the avm1 to fit the avm2 W&H.....
ActionScript 3.0 provides for a way to determine if a swf is for either: 1) AVM2 (or earlier); or 2) AVM3. [link1, link2]My Question:From C#, is there a way to determine if a swf is for AVM1 or AVM2?
View 2 RepliesI am creating a local connection to play an as2 movie, which works.... the first timehah.Observe the link below:http://isokon.net/clientPost/scripts/AVM2_to_AVM1.swf(test the above file by playing the banner, then killing it, then loading a new one and attempting the play method again...)I've tried closing the connection before reusing it, but it says the connection is not open... traces a successful send each time.here is the link to the abstracted FLA: http://isokon.net/clientPost/scripts/AVMCommBug.zip
HTML Code:
var bannerContainer : Sprite = new Sprite();
var connectID : LocalConnection;
[code].....
Let's say we have a directory with 10,000 SWF files.There is a great need to determine what SWF files are AVM1 (AS2 or earlier), and what SWF files are AVM2 (AS3).Can anyone point me in the right direction to determine the AVM version for a large amount of files?It seems like I could write a script that loops through every file, checks some magic hex value in the file's binary data, and records the result somewhere.
View 2 RepliesI have a large project built in as3. Part of its main functionality is to load and unload various as2 swfs. The problem is that the memory ins't free up once they are unloaded.
I have access to the as2 swfs code base and destroyed all objects, stopped and killed timers, listeners, removed from stage, destroyed all the MovieClip.protoypes that were created. They look to be clean as far as the AS2 debugger show no remnants of the object after the destroy function is run. In AS3 i've closed the local connection, cleaned all references/listeners to the AVM1Movie and ran Loader.unloadAndStop(). The trace out in flex says the swf was unloaded but looking at windows task manager the memory usage never drops to when it was before the as2 swf was loaded. Each as2 swf can take up to 80 megs each time it's run so memory gets eaten up fast and loading and unloading a few as2 files.
At this point if the AS2 swfs are unloaded the only thing that I can assume that could be left is MovieClip.prototype and/or _global, _root variables add during the AS2's run time. But i've gone through those and can't find anything else that might be sticking. Has anyone ever seen problems before with the AVM1 machine not freeing up its memory?
Currently I'm working on a flash application that will be used for presentation purpose. The application loads external swf files which are exported from powerpoint. This way people can make there own powerpoint presentation, export with a plugin as swf files included with animations, video or audio.
The presentation itself is a 3D carousel containing icons which represent chapters. Once a chapter is clicked, a page slider opens and loads all external swf files needed for that chapter.When someone is done with that chapter, you can close the pageslider. To make sure the application keeps it performance, it will remove all event listeners, free display objects hold in arrays and get rid of all what won't be used again. This works fine, the memory use goes back to original state and no problem.
Now when I take a closer look at the fps of the application which is set to 60fps, and load AVM2 content, nothing goes wrong whatever I do or close. As soon as I load AVM1 content and display it, the fps stays steady at 60. But as soon I close the pageslider and free up memory, the fps is stuck at 30. As soon I open a chapter with another AVM1 content, the fps restores to 60.Now I thought maybe it's because I did something wrong when I free some memory, so I turned that function off which gets rid of all the stuff. Then I tried again, but again when I load AVM1 content I got 60fps but when I don't display the content my fps goes back to 30. But this problem doesn't exist when I load AVM2 content or even just png's instead of swf files.But when I turn this free memory function on and not display the AVM1 content and which doesn't exists at all on the background anymore, the fps is still 30.
Now I thought about a fix to just restore the framerate afther the pageslider is closed. But as soon I use "stage.frameRate=60" the player crashes completely. how can AVM1 content on display let the application run 60fps, but when removed from memory and not displayed set the fps to 30 and get to 60 again as soon new AVM1 content is displayed? But AVM2 content it's all just fine.
The reason I load AVM1 content is because the powerpoint -> swf exporter can only export AVM1 content.I also checked if the fps of the exported swf is set to maybe 30, but that's not the issue, and besides that it theoretically would use the main swf it's fps.I could set the main application fps to 30 and no one would notice, but I just can't sleep why i can't figure out the issue.Btw when I set the main fps to 30 it won't be reduced to 15fps.
I have a main movie here that loads in an external swf through a container mc. everything is aligned and positioned to where it should be, and they are also set to that value onresize. the problem is, when my swf is loaded in, it works fine and is in the right position, same when you resize it. BUT, if you resize the window before the swf is loaded, it misaligns, until you resize!!
View 2 RepliesIm working on a banner testing application coded in flashdevelop on Adobe Air 1.5, testing sizes, kb, animation time etc. One of the tests ran by the application is clickthroughs via clicktags. Since most of these banners are coded in AS2, I�m injecting the variables via querystring when loading the banners swf files (via a browse/drag drop File reference).
PHP Code:
var req:URLRequest = new URLRequest("banner300x250.swf?clickTag=hello");
This works fine for _root references to clicktags, but when the banner is looking for the variable in _level0 I just can�t figure out how to write these variables.I've tried to load a bridge AS2 movie and set the variables there, something like AVM2 localConnection --> AVM1 localConnection --> AVM1 banner, wich worked fine on flash IDE testings, reading all _level0 on the AVM1 bridge, but compiled on Air became into a security errors storm and undefined values for _level0.
I have a AS2 header that loads some obnoxious sound on the initial load. I created a simple AS3 container that loads and mutes the sound - which works as expected. However, now the displayed swf is smaller than the original. Basically all I am wanting to do is mute the original without changing any of the dimensions.here is the code in question:
Code:
package
{
[code].......
I've been playing around with ABC bytecode and was hoping someone could clear up a point of confusion for me. I have a simple flash file that places a clip on the stage and has a tiny script to update its position on each frame. The code looks something like:
[Code]....
My question is how does the 'getlex' operation work (I've marked it with ###1). It is passed a multiname which references the 'moveit' method of the class. Unfortunately, the 'name' field in method info seems never ever to get used by the compiler. All methods have the empty string as its name (Shown above as the unnamed function at ###2).
How does the flash player link the multiname to the unnamed method? There appears to be no provision for this in the AVM2 spec. I know it's possible because commercial decompilers like sothink manage to determine the method name. I'm just not sure how they do it, or how the code could ever work.
Does anyone know a good way to convert AVM1Movie objects to AVM2?
View 0 Repliesi am loading lots of swfs into a movie container.. is it possible to resize every swf to the same size?
View 4 Repliesa .fla is 500 x 300. Inside, content moves OUT of the 500 x 300 stage so that it appears like it hides or moves off of the screen. .fla complied... loaded into Flex via SWFLoader:
<mx:Conainer width="500" height="300">
<mx:SWFLoader width="100%" height="100%" />
</mx:Conainer>
Loaded .swf file shows outside of the 500 x 300 Container in Flex. How can i get it so that only what is INSIDE of the Container is visible?
I've got a few buttons on stage and each button loads a external swf. What I'm doing is adding this external swf to a movieClip (myMC) which is already present on the stage.The size of myMC is 730x340, I want that the external swf which is loading should fit perfectly into this movieClip (myMC).
View 4 RepliesI'm trying to import images into a movieclip [URL]. I now have the image loaded but was wondering how to resize it using actionscript 3.
View 1 RepliesIm loading in my main swf, which will take the place of the preloader(which consists of the entrance) like so...
Code:
var entrance:Entrance = new Entrance();
addChild(entrance);
import gs.TweenLite;
[code]...
However, for some reason or other, my loaded swf isnt visible until i resize the stage.Ive been trying various things with the way the preloading is done, but it doesnt seem to change anything, and also ive tried taking out the tweens but that doesnt do anything either.
how can i position an externally loaded MC on browser size were if the browser is resized the mc follows and stays in view instead of been shifted out of view
i can get it to work if my MC is on stage but it dont work if the MC was loaded externally it loads but does not position/follow the browser edge and goes out of view below is the AS2 code
Stage.scaleMode = "noScale";Stage.align = "TL"; var stageListener:Object = new Object ();stageListener.onResize = positionContent;Stage.addListener (stageListener);positionContent
is there a way to set the loaded SWF's height and width to always use 100% of the Loader's height and width? pretty much like when you're embedding a swf to an HTML page... I know that you can do this by setting the width and height of the Loader on every stage resize, but is there another way wherein you can just specify height and width is 100% and then loaded SWF will automatically resize according to stage and Loader's current dimensions?
try loaded a SWF file which has coordinates based listeners and it seems that the loaded SWF doesn't reposition its listeners correctly even if the stage is already resized... take this swf for example [URL] i tried using an SWFLoader in flex which scales the content and also a normal AS3 flash.display.Loader and it seems that both fails to reposition the listeners correctly.
I need to add the image to an object as a child.. then resize it.. I know how to add it as a child (easy rly)[code]...
View 3 RepliesSo this is loading images by looping through a xml file and displaying them on the stage... The images load fine only they're way too big. Problem is when I add .width to myLoader the images disappear all together.
ActionScript Code:
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("data.xml"));
var myLoader:Loader = new Loader;
[Code] .....
I have been looking around a bit everywhere, but everything I've tried just don't work.I am looking for a simple way to resize an externally loaded picture in AS2.Exemple:We have 4 movie clips (that we will use as containers), and 4 JPEGs, each with a different pixel resolution. What we need is to first, load these JPEGs into their movie clips (no problem for this part > using loadMovie), but then resize them (once loaded) so that they all have the size they are supposed to be (let say here they are all supposed to have a size of 150x100 pixels).Problem is, I have been trying many ways to resize them, but so far none of them work..._width and _height do not work either since they seem to work proportionally of the original loaded picture (ie. a 640x480 jpeg will not be resized same as a 1280x740, which I think is weird... but well).
View 1 Repliesi'm trying to resize dynamic loaded images, they are loaded from a xml file into a existing movieclip in _root. When I try to resize using _height and _width the images just don't show in the swf. I searched the forum and found that _xscale and _yscale works, but I really need to resize the image with _height and _width
View 4 Repliesi am trying to resize externally loaded swf`s that are 800x600 to fit in a preview window that is 124x93.. everything works great as long as the external swfs have a MC that fills the stage (i.e that is 800x600)
[Code].....
how can i resize the dynamically loaded pictures: i have around 100 pictures, and i don't have the time to make thumbnails from every picture. i'm thinking to change the image size to display the thumbnails.In the xml i want to put only the <image>the link of the picture</image> code, and in flash i want to resize this image that will be displayed in the thumbnail scroller.
View 4 RepliesI'm trying to resize an image loaded in a movie clip, so that any image I load will always fit correctly in my movie.The script is pretty simple, it reads an xml file where they should be 6 records. Loads the image in the Thumb attribute in on of the 6 containers eg. _root.screen.Event1
Code:
for (i=0; i < 6; i++){
MyEvent = Event[i].attributes ;
_root.screen["Event"+i].Title.text = MyEvent.Title ;
[code]....
It works but not as expected. It looks like only the container is scaled down not the image really.
I've got a gallery that loads images in using MovieClipLoader. Unfortunately once the images are loaded they don't seem to want to be resized.I've added an empty MC to the stage for each one and loaded the image in, then I try to resize it to fit the screen. Tracing the size after the onLoadComplete event returns 0 and changing the size makes the clips disappear from the screen.
View 1 RepliesI have a slide show script that will load images from an xml file. I want to have anyone upload images and the slide show will resize the picture to fit. Here is my script:
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
xmlImages = new XML();
[Code].....
Wel I know how to load pictures dynamicly into a MC, but is it also possible to resize te picture?
View 3 RepliesI am trying to resize an image and display it on stage but i get the.......... error 1119: Access of possibly undefined property bitmapData through a reference with static type flash.display:BitmapData........this is driving me a bit mad because i got most of the code out of essential actionscript 3.0.....I've tried to debug it myself but my debugging skills aren't very good yet
PHP Code:
package NetConnections.PicClick{
import flash.display.*;
[code].....
Please help I've been researching this topic for like 2 days straight and it is driving me insane because I can't seem to find a specific answer for what I'm trying to achieve and I know it can be done because I've seen end results on the web. Here is what I'm doing:
1. I created a simple museum gallery with 3 portraits hanging on the wall
2. Inside the museum portraits I created 3 different uiLoaders with a black background
3. I gave all 3 uiLoaders their own unique movieClip names
3. Inside each uiLoader will be a loaded external image via a URL
4. I DO NOT want to resize the uiLoaders - I want to scale the external images proportionately to fit inside the entire contents of the uiLoaders and still remain centered
URL...As you can see currently the 3 random external images are loaded perfectly inside the uiLoaders but you see black background and I want the photos to fit the entire contents of the uiLoaders yet still remain proportionate.[code]