ActionScript 3.0 :: Loading A .swf, Keeps Loading Into New Window?
Nov 2, 2009
I am attempting to play with AS3 for the first time. I have a combo box that I need to load in different .swf files when something is selected in the combo box.
I have 2 functions, one will load a different url, based on what is in the data field for each item in the combo box when selected:
function changeHandler(event:Event):void { var request:URLRequest = new URLRequest(); request.url = ComboBox(event.target).selectedItem.data; navigateToURL(request); aCb.selectedIndex = -1; }
The other function loads in a .swf which is what I want:
function changeHandler(event:Event):void { trace("you clicked me"); var loadit = new Loader(); addChild(loadit); loadit.load(new URLRequest("movie1.swf"));}
but it's not set up based on the selectedItem.data so it doesn't change based on what is selected in the combo box.
I'm not sure what needs replaced in the second function to get it work like the first with the selectedItem.data....?
I have two movies that I want to show but in different windows. eg. I want to show the first movie in a window and then be able to click on a button then it opens a new window for the second movie. I have tried to do it but it still comes up in the same movie window.
I have two movies that I want to show but in different windows. eg. I want to show the first movie in a window and then be able to click on a button then it opens a new window for the second movie. I have tried to do it but it still comes up in the same movie window.
Each page is on a separate frame, link/button actionscript consists of gotoAndPlay(x), etc.
I have one product page that has enough content to where you have to scroll down in the browser window to reach the list of products. Each product image is a link to a more detailed description page/frame. My problem is this: when I scroll down in the browser window and click on one of the product links, the product details page loads, but I am still halfway down the page in the browser. I then have to scroll up to view the content. If you need to see what I'm talking about, go to villajerada dot com, click on Olive Oil, scroll down and try out one of the product links.
I've tried several approaches to resolving this, listed below:
1. External Interface Call:
(In Flash) //ExternalInterface.call("scrollTop()"); //var request:URLRequest = new URLRequest("javascript:window.scroll(0,0)"); (In the html document)
[Code].....
Results: No matter what I do with this option, my browser always opens a new tab. I'm trying to build a site that will work with everyone's browser, regardless of their settings, so changing my own personal settings to resolve this isn't a solution. All I know is that I've tried several versions of it after reading other forum posts. Ideally, I wish that there was a way to navigate to a URL that ends up being a null object at the top of the page.
I found two tutorials that both contain pieces of what i am looking for but i cant seem to figure them out and get exactly what i want. Here is the firstIn the first one, the general idea is what i am looking for. Except that i want to load a movieclip and not an image. My problem in this one is the button component that is used. I have no clue how to skin or customize the button, and i cant find a good tutorial to figured it might be easier to just change the actionscript for this. I want to be able to create my own button (instance button) and use that so that when people release that button, the movie clip pops up![URL]
With selenium I'm currently automating tests for a website having flash elements for user inputs. While everything works fine when executing these tests on my computer locally, it fails to load the embeded flash if I start selenium on a remote Windows XP machine. However, the flash just loads fine if I start the tests while I'm logged in via remote desktop.
This leads me to the assumption that whithout any desktop environment loaded or user logged in the firefox window is treated just as though it was minimized or the current tab was inactive, which I know prevents flash from loading until that window/tab is activated.if there is a way to enable firefox to load flash even if it's not currently displayed in an active window?
if it is possible to load basic html web pages (like text) into a movie clip, or at least use actionscript to set the bounding box of the new window to have the same border region as the original movie clip (such as 600x400 pix at x+100, y+150, for example).
Alternatively, is there a method in which I could load several large scale text files into a region of a movie clip, without having to create endless .as files filled with thousands of
I have a site build with several swf sections (Home,About,etc...) loaded via XML. The thing is that one of the sections needs to be larger than the browser windows height, actually a lot larger.
So i need to find a way so that the browser's scroll bar will appear only for that specific section...
Right now it works if i change the dimensions of the main movie container and edit the index.html: overflow:auto;
But what kind of code should i use to let the browser's scroll bar appears if a movie that is loaded via XML is larger than height of the browser...
I've seen a cool effect on: [URL]. Click on DEVLAB and than select the fourth icon. When loading the movie, the browser-window changes it'd dimensions. How can I do this?
I have typical situation where big loop is loading lots of images and its done asynchronous which make browser to frees during loading and I want to make it synchronous but having big trouble doing it. I found this class synchronous loader and it work great but you cant add mouse event listener to loader. Here is sample code:
I have a game built and I would like to reduce the loading time to the minimum possible.One of my ideas is to load the essential assets and some lower quality images the first time, leaving the higher quality images and some of the functionality out at first (for instance things like buttons that change the background color), and once the player enters the game, the rest of the functionality and its assets (images and sounds) will be loading in the background using the Loader class.So once the non-essential assets and the high quality images have loaded they will fade in and substitue the lower quality assets in the most subtle way possible.
Also... Would it be better to have various instances of a "Loader" class and try to load everything at once, or load stuff in order with a single instance of the "loader" class listening to the Event.COMPLETE event ?
I have a movieclip clip that plays when the movie starts, the movieclip is a visual assets that show's that the application is loading some information but it's not showing any loading progress, just playing while the assets are loaded.I created a for loop that will load the assets using a simple loader, and then when the object is loaded the application push the object to an array.Problem is that when the loading starts all the animation that i have on screen stops until the loading is finished.The whole point is that the animation will play while it's loading.
I want to have an AS3 app load images from url supplied by the user. But I don't want a malicious user to be able to load an SWF file in place of the image, such as with an altered extension "maliciousSwf.png". Well, not sure how big a security threat that is above and beyond the ability of the hacker to decompile swf, but I think that ideally such behavior should not be allowed.
So, is there any way to prevent this? When people allow users to load images in their Flash apps, do they somehow guard against loading of SWF? Or is this really absolutely no big deal?
How would you defer loading of other graphics on the page until after the images in a Flash gallery's images.xml file are finished loading?Is there any way to detect for this, or would I only be able to check if the flash swf object is finished loading? I'm pretty sure the swf object would be loaded/ready as with document.getElementById('flashobject').onload = function(){}; before the corresponding images have loaded though, instead of after.
I am loading images of different size and then images are scaled and border is drawn for each image as shown in below link,[URL]... I want that border of images to be of the same width and height and for that I need to find out the max width and height size image before loading all the images. Is there any way that I can know the width and height of an image before loading it completely?
Suppose I have 5 links that load different SWF files. I'm loading the first one in the background and I will continue to load the other SWFs once the previous one has completed.Suppose a user clicks link 4 but only SWFs 1 and 2 have been fully loaded and SWF 3 is currently being loaded. Would it be possible to pause loading 3 and skip to part 4 and finish loading that?
I'm building a flash website which uses a google map for a contact section and another one generated via external class for a projects section (for each one of the projects available there will be generated a map and a marker).This website uses SWFAddress and each of the projects receive SWFAddress dynamicaly via xml, pulling in the name of the project.The problem is when I test the website localy, on Flash IDE both the maps are loaded fine, but once I try it online on a webserver just the map on contact section is being loaded.I've tried to use a different key for each other -the contact section map key based on an url.Does anyone know what the problem might be? Is it because I'm using 2 maps on the same website? Is it because the url generated by SWFAddress is too long (I tried to generate a key based on something like URL...
I tried searching for an answer to this on the forums and it seems you can't duplicate a movieclip that has a dynamically loaded jpg in it, I mean you just get a duplicate empty movieclip?What I want to do is have 3 copies of a pic, each tinted a little differently, and have them converge and reveal the "composite" of this pic. Do I then have to use loadMovie 3 times?Does loading the same 50kb image at the same time mean you're actually loading 150kb?
i was creating my portfolio using xml gallery script from this site. the thing is that it loads one picture at a the with a preloader between each load. is there a way to load the first image and keep loading the rest so there will be only one loading time? here is my action script:
I have a "loader.swf" after which my "main.swf" loades. I have used a loaderPro v3 (AS2) component. Doing that was easy but then when it starts loading, even before the loading completes the main.swf starts playing in the background. And i have no coding in my actions panel.
I have two xmls, xml1 and xml2. Both have same structure, only data are different. Button 1 loads xml1 and button2 loads xml2. Both calls same function to load XML. First i press button1, so xml1 starts loading, but if before xml1 is completely loaded, i press button2, xml2 also starts loading. If for some reason the xml2 loads first i get data from xml2. But when i look at the bandwidth profiler in flash , xml1 is still loading. When xml1 is loaded it will replace data from xml2. SInce i pressed button2 last, i would want data from xml2. So is it possible to stop loading the previous xml when i start loading another xml?
I'm loading a external swf into a movie everything is fine with that. The only problem is that its loading only a part of it. Does anybody know why? Also, this swf is a mp3 player with streaming. The streaming part works but the playback doesn't.If i start only the mp3 player by itself it's working.here is the fla for the player
I'm trying to load a SWF movie into a target movieclip called blankmc. The SWF movie is loaded from an absolute URL (eg. [URL]/img/20042005113934movie3.swf ) My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG! Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?
I have two separate slideshows in my document. The slideshow on frame 1 uses ixia_works.xml, the slideshow on frame 5 uses ixia_windows.xml. wrote all of my slideshow code on frame 1 and created a variable to hold the xml file. On frame 5 I assigned the new value of the variable. The slideshow on frame 1 works perfectly; the slideshow on frame 5 won't even load.
Code on frame 1: //in order to work with tweens, necessary to import tween classesimport fl.transitions.Tween;import fl.transitions.TweenEvent;import fl.transitions.easing.*;
i am making a site with transitions that loads external .swf files(exactly like the tutorial). after the first part of the transition plays it uses:
[Code]...
So i guess my questions is should i add the load movie code before this code or what. how do i make this apply to loading the actuall external swf files??
I've been working on building a flash website for my company and was finally getting somewhere when I encountered a problem I cannot solve. I have it setup so that when you click on an item on the first scene it plays the second scene which is where the customization of the item is to take place. The second scene is where I am encountering the problem. I have seven buttons on the left side of the stage that are on their own separate layer. Everything was working fine until I saved and quit. Now when I bring up the second scene the buttons are all grouped together and uneditable. Also the buttons are extremely small and when I compile the swf file and view the movie all I see is the label of the buttons not the actual buttons themselves. I have tried deleting the button layer completely and redo the layer but every time I add the button component it add the same tiny uneditable button. I am including the errors that I am getting in output when viewing the swf.
TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at fl.controls::BaseButton/drawBackground() at fl.controls::LabelButton/draw() at
Ive got a menu on top of my page which has a few buttons. On each button press, I have a standard "_root.pages.gotoAndStop(frame#);" and also a function call which loads a different picture into the background. So, the page appears, and a loader shows "LOADING BACKGROUND" and then once its loaded it fades in overtop of whatever picture was there.roblem is...if I click the buttons fast (before the background loaded), the pages work fine, but since the background didnt fully load, the correct background for each page seems to get confused and isnt right.Here's the function that loads the back pictures...
Code: var fadespeed = 5; function load_pic(myLoad, myNum:Number) {
this.stage.loaderInfo.bytesTotal; with that line of codedoes stage mean the loading of the entire swf is monitored or the loading of objects which are used on the stage are monitored? can specific objects (say a specific movie clip) be targeted?can externally used AS scrips be targeted? and what does "this" doe