ActionScript 2.0 :: Load Swf In Center Of _Level?
Aug 15, 2006how I can center a swf, when I load it into a _level?
View 1 Replieshow I can center a swf, when I load it into a _level?
View 1 RepliesI am loading an external swf into the mc 'image' using: image.loadMovieNum("portfolio/100_design/1.swf", 1);
Every time a new image loads, I want it to load the level above, ie: image.loadMovieNum("portfolio/100_design/1.swf", 2); Is there a way this can be done dynamically. For example, "current level + 1"
Loading stuff in levels ( MovieClipLoader.loadClip(picOrSwf, 1); ) and want a -for to do- loop to make them all _visible = false; but can't get it to workfor (i=0; i<total; i++) { _root[_level+i]._visible = false; } is the closest I got. (_root[_level+1]._visible = false; DOES work, but is no good of course).Let me know if this outlines my problem goo
View 4 RepliesLoading Images in _levels via loadClip. Now i want 2 buttons on TOP of the Images. So first tried attachMovie _level 200. Did't work (don't ask me why since all logic says it should. but I'm guessing a difference in loading between loadClip & loadMovie). Now made 2 swf files with just the buttons and load via loadClip. Works fine BUT... now I can click then. tried stuff like:
Code:
_level200.button_btn.onRelease,
_level200[button_btn].onRelease, _level200["button_btn"].onRelease, _root[_level200["button_btn"]].onRelease
You get the picture. Any solution to this?
I have a loaded SWF file in _level1 that has audio in the timeline. I am trying to control the volume of this loaded SWF with a 'mute' button in the main SWF file. On the first frame I'm using the code:
my_sound = new Sound(_level1);
and then on the button script I have:
mute_btn.onPress = function(){
my_sound.setVolue(0);//mute volume
}
but it's not working. Is the new Sound(_level1) not valid?
I have a loaded SWF file in _level1 that has audio in the timeline. I am trying to control the volume of this loaded SWF with a 'mute' button in the main SWF file. On the first frame I'm using the code:
my_sound = new Sound(_level1);
and then on the button script I have:
mute_btn.onPress = function(){
my_sound.setVolue(0);//mute volume
}
but it's not working. Is the new Sound(_level1) not valid?
i have an xml gallery which works but when i cycle through the jpgs and come accross one a different size it loads it from left align i want center align
ActionScript Code:
var xmlRequest: URLRequest = new URLRequest("imageData.xml");
var xmlLoader: URLLoader = new URLLoader(xmlRequest);
[Code]....
However I am using embedded .swf files, and the scrollable image I want to control is on _level10 (within a master file _level0). I am decent with actionscript and based on tests with the example file, I know the code works. BUT my problem is getting it to function within a different flash level. I'm about 99% sure it isn't working because the code is looking for my movieclips or the scroll function on the main timeline and not that of _level10, but I can't figure out where the code I need to change is. Its driving me crazy.Here's the code (from the above link). This goes into the main timeline, where "area1" is the movieclip you hover over to enable the mousewheel and "mc1" is the mc that is moved by the mousewheel:
Actionscript Code:
// IMPORT import FlashCommon.MouseControl;import mx.utils.Delegate;Stage.scaleMode = "noScale";// ADD SCROLL FOR AREAS - addScroll(id, mc, function)//// adding scroll
[code].....
why my MC actionscript with loadVariablesNum("submit.php", 0, "POST"); don't wanna work if I loaded into other _level...
If i don't loaded it work well... but not useful
I am trying to load an external 1.swf that contains a xml gallery into enter_mc.container_mc that is positioned in the center of the stage but an external .as file. I have had success when I make the container_mc have a graphic in it that is the same size as the incoming swf (this way when the browser is resized the loaded swf doesn't jump as the size of the mc changes) With the xml gallery the size of the element move depending on the images being loaded. I have tried to use a larger (than the gallery) graphic to keep the gallery centered. but that didn't work. I guess the issue could be solved by the external .as file having some script that constantly positions the centre_mc in the middle of the stage. I am unsure how to fix this as I am new to flash
View 1 Repliesim trying to load a swf in the center of a full swf background and cannot get it to work.
i got the resize function to work properly, but when it first loads it is not centered properly
for some reason it recognizes the resize code by not the initial code
here is the code im using (note: im using the full background code from noponies):
Code: Select allimport com.display.FullBrowserBg;
var newBrowserBg:FullBrowserBg = new FullBrowserBg("images/stuccoBG.jpg", false);
addChildAt(newBrowserBg,0)
[Code]....
I have built a gallery similar to the one found on Kirupa with a siding thumbnail gallery that references xml. Everything works great except that the images I want to load at their large size vary in width so when they load referencing the upper left hand corner they are not centered. I would like to load them so that each image in centered in the "picture" image area. I created a new movie clip and gave it the instance name of "picture" and center justified it but the images now load with THEIR upper left corner in the center of the "picture" image area. do I have to add code to the xml? is there anything I can ad to th AS to load pictures centered?
View 4 RepliesI have loaded as2 swf in as3 using Loader object. Loading is done fine, but the problem is that the as2 swf uses stuff like _root, _level1.. etc. that doesn't work in as3. So is there any way by which I can make as2 swf work properly inside as2? I have bought some readymade as2 swf and need to use them here. I dont have the as2 fla so can't make any changes in them...
View 9 RepliesI want to create an array of object so that I can store the _level I want to load image at specified level and and to keep track of levels in an array so that when any new image will be loaded I can get location of previously loaded image and place the new image before the last image
Code:
loadMovieNum(_global.myXML.childNodes[0].childNodes[3].childNodes[5].childNodes[0].attributes.path, 178);
_root.mcTray._alpha = 100;
_level178._x = 20;
_level178._y = 620;
i read about the tutorial on loading external swf into levels. I have the following codes in Layer Frame 1:
Code:
loadMovieNum ("World.swf", 1);
_level1.gotoAndStop(2);
stop();
When i execute this code, world.swf is loaded, but i cannot get it to go to frame 2, and even if i use _level1.stop(); or _level1.trace("HI");,
I have attached a zip file which has a main.fla and a folder pages which contains 2 fla's p1.fla and p2.fla.The main page loads the first page which is p1 and as the main page has 2 buttons i am using _level script to know which page to load, actually i wanted to create 3 buttons. Since i have already created 2 buttons the first page automatically loads but when i click on the 2nd button it does'nt the p1 page goes but it comes back again.In the main there is a movie clip which has an instance name of page_mc and the code inside it is:
Code:
nextpage="pages/p1.swf";
loadMovieNum(nextpage,1);
b1.onRelease = function() {[code].....
I have a center window and a background in my flash file. I am trying to get the center window to stay in the center of the web browser screen and get the background to expand and fill the entire web browser screen below center window layer. Sort of like this site [URL] I've currently converted the background to a movie clip and have this code.
[Code]....
My flash movie is 1440x900 but the area where all the important stuff happens in within 1024x768, i am trying to keep the middle in the center regardless of browers size or aspect ratio.
I can center the page but it doesn't work as i need it to. If the browers is small (1024x768) the swf is justified against the left edge, but not keeping the middle in the middle of the brower.
[URL] is an example of exactly what i am trying to achieve.
Here's what i'm trying to do: Hide a MC depending on the path variable as:
[Code]...
Well that doesn't work, for some reason, i can't use a string as a multiple level path..
I'm having trouble centering the stage on screen, its locked to the top left of my window and nothing will make it move. I remember accidentally pressing something on the keyboard just before this happened, but don't know how to get my stage center again. The hand tool does nothing.
Oh and its only happened in this fla, other fla's are fine.
I have been looking all over the place for what seems like should be a really easy thing to accomplish.I have a swf that is 1060x630px and I would like to center it on the page... at the moment it just sits in the far left corner of the screen when I export it to html. My knowledge of html is minimal but I am guessing that this needs to be done in dreamweaver.
View 2 RepliesI'm loading a background into a background container with the following code:
loadMovie("backgrounds/bkg_wht.swf",bgContainer);
I'd like it to load in a 4 second alpha fading load instead of just a hard load. Any ideas what code I need to write?
As you can see in my code, I'm trying to adjust on the fly the x and y properties so that the movieclip gives the impression to rotate from its center and not from its corner at 0,0
Code:
var myclip:MovieClip = new MovieClip();
myclip.buttonMode = true;
myclip.graphics.beginFill(0);
[code]....
but it doesn't work and the clip does not rotate well
Just upgraded to Flash CS4. Published .swf/.html files... Trying to get the .swf to display in the center (horizontally) of the .html page / browser window. Previously I used <div align="center"><object>...</object></div> but that no longer works! It displays centered from within Dreamweaver but not in any browsers I've tried. Can't for the life of me figure out why!!
I noticed Flash CS4 now spits out a whole lotta code in the generated .html file and I'm assuming the source of the problem is somewhere within.The only workaround I've found so far is to publish just the .swf and manually embed it into a new .html page... but then I no longer have all the (detection) code.
Is it possible to center an swf in the html or php file, when the swf has a width larger than the browsers width?
View 2 Repliescreated in flash. The issue i am having is when an image is loaded it always appears on the left handside attached to the top left point of the stage. Is there anyway i can get these images to load in the centre of the stage? This is the AS that is attached to my flash document.
Actionscript Code:
function initGallery() { function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; total = xmlNode.childNodes.length;
[code].....
I am using the following script in AS3 in order to rotate an MC around its center:[code]Works great, only rather than a CLICK, I would like the mouse to cause the MC to rotate in response to the mouse's movement up and down the y-axis of the MC I want to rotate. How can I write a script so that the mouse location in relation to the y-axis of a specific MC will trigger something?
View 1 RepliesI'm using myship.height =+=1 to change objects height but it changes height from top of picture rather than the center. How do I change it so its origin is central and grows outwards rather than downwards if that makes sense.
View 3 RepliesI have been using Flash for a while Flash 8 and now Flash 9 I dont know too much about the program, someone wrote the program for me and I update it. When ever I publish the Site to upload to my server I have to go into the HTML file and insert <center> twice to get the site to be center on the web.It is not a big deal to edit the HTML file but every time I do it I figure there must be some button i dont have checked in Flash to just do it automatically.Seems like with such a huge and powerful program that must be an option that I am missing.
View 5 RepliesI have created a movieclip with programming and added a image via xml loader. I am scaling it down using tweenlite. But it scales as if the registration point is on the top left of the image. Do you know how to change it so it scales from the center?
View 6 Replies