ActionScript 2.0 :: Code Which Can Check To See If The Background Swf Is Already Loaded Into Its Container?
Jan 9, 2008
I am creating a site where there is a portfolio section with icons for each piece of artwork.Regardless of which icon 1-10 is clicked, for the first time ONLY, I want to load a swf which "draws in" a portfolio "background", and another swf on a higher level which corresponds to the icon clicked (lets say a sample artwork).
However, if the user has previously clicked another portfolio icon and is currently viewing one of the portfolio pages, there is no need to load the "background" swf again (it would be tedious watching the drawing in animation over again).
I've designated a target container movieclip for each.The icons swf file with the buttons is another swf on the timeline.Is there some code which can check to see if the background swf is already loaded into its container? And in which swf would I attach the code?
I need a fairly foolproof way to check from a child swf whether it is loaded into a container swf through a loader object or if it is just loaded through html. I would like to do this without requiring a flashvar or any kind of function call from the parent swf that may be there. Any quick and simple solutions? I looked for something with loaderinfo but came up empty.
I'm new to AS3 coming over for AS2 and trying to figure out how to code a simple load sequence. I've got two scenes, "Scene 1" and "Scene 2". I've got a MC that is a simple shape tween that loops in the "Scene 1". I'm trying to assign code to this MC that will check to see if frame 40 of Scene 2 is loaded. If it is, gotoAndplay Scene 2 frame 1. If frame 40 of Scene 2 is not loaded, continure to loop the MC unitil it is. Here is the code I've got for the MC in the "Scene 1"
onClipEvent(enterFrame) { if (i > 40) { gotoAndPlay("firstframe", "Scene 2"); } }
"firstframe" is the frame label for the Frame 1 in Scene 1. This seems more difficult in AS3 than AS2.
How can I check how many movieClips exist in a container and how much space are they taken?
In other words, how can I make this calculation if I have a rectangular movieClip (containerMc) that is 5x1px and five square movieClips (sq1Mc,sq2Mc, sq3Mc, sq4Mc and sq5Mc) that are 1x1px and which can dynamically be placed inside containerMc and I want to know how many and which of these five movieClips already exist in containerMc so I can determine where the next square movieClip needs to be placed?
Can someone be so kind and show me how to do this or direct me where I can find the answer?
In other words, how can I make this calculation if I have a rectangular movieClip (containerMc) that is 5x1px and five square movieClips (sq1Mc,sq2Mc, sq3Mc, sq4Mc and sq5Mc) that are 1x1px and which can dynamically be placed inside containerMc and I want to know how many and which of these five movieClips already exist in containerMc so I can determine where the next square movieClip needs to be placed?
I have a button on stage which has a child menu movieclip and that movieclip has three submenu button children.On each of these 3rd level buttons an event listener draws a new container on the stage and adds a new movieClip holding various info.This all works nicely, but I cannot work out a way to get an eventListener on the menu buttons to check if the container already exists so I can then stop the button repeating the add container function. So, at the moment you can repeatedly hit any of these menu buttons and they will just continue to add info movieClip children.I've tried some nice Boolean commands that should work, but I think it's the nesting of the children/relationships that are not allowing me to get this to work.So, basically for arguments sake, let's say I only have one of each item... here's the nesting of children:[code]
scrolling TN that I purchased for $10. I want to create many different galleries (many swfs) using this XML gallery and then load them into a container inside a "master gallery swf" if that makes sense.The problem I am having is that the swfs are getting re-sized smaller when loaded in the container (maybe 70% of the original size) even though the container and swfs have the same dimensions.I've actually had this problem before where a swf displays smaller, even if it's just inserted into an HTML page. I'm wondering if there is a simple solution
I need to communicate from loaded swf to the container swf in AS 3.0. This is the code for document class of loaded swf followed by code for source swf document class. How I can call the method xyz() from the external swf?
ActionScript Code: package com.scottgmorgan { import flash.display.Sprite; public class ExternalMovie extends Sprite { public function ExternalMovie():void { Code] .....
I used guestbook form here:[URL] and when I load it into a container in the flash website the guestbook doesn't read the data from txt file. It works ok when it's alone.
Here's a little script i wrote to check for a serial code to a xml file, and allow the user to use the flash document. this code seems pretty useless, but in all reality you can sell you flash document, with having users to input a serial code in order to use the flash document.
which might allow flash developers to make money on such a pointless project. eg. sell games, as a (.exe, or a .app) file, or make then buy a serial online an play it online. or sell very useful programs, for real money, and don't have to worry about people using it for free.
[Code]...
NOTE: i am not responsible for any lost of anything due to this actionscript code that you have choose to use at your own lost, of hackers, cheating you to use your flash document for free.
I have a main swf that will load external swfs into a container. I need to detect the end of the loaded external swf in order to start to load and play a new one into the same container. The problem is that i do not know what the length of the external swfs will be, and will have no control over the development of them, so i cannot place a variable at the end of their animation which would allow me to detect from the main movie its end. I also cannot rely on the _totalFrames property because the loaded swf might not have all the animation inside its main timeline.
I have a container on the stage in which a swf is to be loaded when you click a button. This works fine when the content of the .swf being loaded into the container does not have content floating outside of its stage, this is a problem for me because the .swf being loaded in has content that exceeds the width of its stage, but is masked. The masked content on that page will be made visible when the user mouses over the masks. So its essential that the .swf being loaded in exceed the dimensions of its stage.
Initially, when I click a button that is a child to the menu_mc, the swf loads into the container correctly, but when I MOUSE_OUT of the menu_mc the content within the swf scales to reflect any content that exceeds the width of its stage. I'm not sure if this is the result of the way I am the loaded swf. The swf is designed to scale up and down when the user MOUSE_OUT or MOUSE_OVER of the menu. The menu is designed to be hidden when not in use.Here's my code:
Additionally, I ran into a problem when I moused over the buttons that are children to the menu_mc. Whenever I rolled over them the content in the menu would hide itself off stage. So I came up with a solution that may not have been the appropriate course of action, but worked. In the MOUSE_OVER function of the buttons, I provided y coordinates for the other movie clips to prevent them from moving off stage. For the sake of better coding practices, would there have been a much more appropriate coarse of action.
I'm trying to somehow target a MC being loaded into an empty container MC. I've tried everything I could think of.
Basically, I'm making a movie editor. Right now clips are added to the stage on initial load, then when they are clicked on they are added to the "reel" and they can be previewed in the order that they are added. Now, I'm trying to get it so that when they are on the "reel" they can be click and dragged and rearranged.
Here's how the clips are added to the stage in a function called loadClips():
Here's how they are being added to the "reel" in addClips():
ActionScript Code: if (currentTarget.name == "1") { clipCopy = new Clip1();
[Code]....
Now, I just want the clips that are on the reel to be click and drag-able (along the X axis but I'll worry about that later). I realize now they're all being added as clipCopy. That's going to be an issue huh? Is there a way that I can target the container and make that mobile?
Finished with coin toss gameWhat done good, what wrong..? what need change? what method better?And now in this user can be winner just 50% ?Attached files.Also code here:
I am trying to replace some code which loaded an external image and triggered and function once completed with code that uses and embedded image. The relevant code looks like this.
Code:
[Embed(source='globe.png')] public function Globe() { var imageLoader:Loader = new Loader();
[code]....
The commented out section is where it used to take the loaded image and apply it to a texturemap.I need to replace the lines of code in the first function with something that calls the second function correctly.
I have tried using function imageLoadComplete (e:Event = null)and calling it with imageLoadComplete(); in the first function but although it compile and runs without error, the program does not work properly. I suspect this is to do with the dispatchEvent(); line which I do not understand.
i'm a designer trying to step up my flash skills and have a scripting problem that's causing me trouble. essentially i have a child swf loaded into a container in a parent swf and want the child to be able to instruct the parent. to explain in full, the child contains an flv with bespoke video player components. it's container sits in one frame of the parent. when the flv finishes playing, i need the parent swf to move onto another frame. as it's a controllable flv, it isnt possible to predict the exact length of time the child will need to be present, so it literally needs to tell the parent it's finished playing at that very point.
Running into an issue where the if I add a Bitmap image into a movieclip the bitmap will appear slightly Blurry.When I add the Bitmap directly to the scene it appears normal. Is their a property for a movieclip that would explain this behavior? or is their some other solution to keep bitmaps from becoming blurred?
I have several external SWF (child) movies that are to be loaded upon demand into another SWF container (parent) movie file. Pretty straight forward. Each of the child movies has MCs communicating with other MCs within the same child movie. For instance the timeline of one MC will have a frame action, which targets another MC instance to play(). Again, Pretty straightforward stuff.
These files work beautifully when viewed independently. The problem is when they are loaded into the parent container movie the target MC functionality no longer works. I believe it's because once the child movie is loaded into the parent movie the absolute path of the targeted MC has changed and what was once the '_root' in the child movie is no longer the actual root?
I have tried both methods in the child movie:
//method without using 'with' _root.ContentWindow.play(); And using the 'with action like so: //method using 'with with (_root.ContentWindow) { play(); }
It would seem that in theory once the Child SWF file is loaded into the Parent SWF file the targeted path would have to have another level in it - cuz now the MC 'ContentWindow' is no longer one level down from the '_root' but two levels? For example: _root.LoadedChildMovie.ContentWindow.play()
give me the Regular Expression that can check if a given string has any HTML code in it, and coming to think of it I would be bothered with <a href="something">something</a> exactly.
I am trying to load a swf(as3) into another As3 Swf with the Movieclip loader. After loading however Loader.width/loader.content.width returns an exaggerated value than the actual width of the swf being loaded. Any pointers on where to begin looking for the discrepancy?
More Details (if it helps)
The swf being loaded has UI components like dropdowns, input boxes and combo boxes (its a Form to fill up), and a coded one-time tween. When the child MC loads into the parent movieclip, the Loader.width value returned is exaggerated by about 28 pixels (although the height remains the same). Loader.content.width also returns a 28 pixel exaggerated value. The Exaggerated value is more than even the stage width of the child MC. The extra ~30 px are upsetting subsequent code in the parent movie to scale and center the loaded swf.
update:
stage.stageWidth returns the correct Value.Code used in the parent MC, to load external SWF:
private var deadURL = "child.swf"; private var deadReq:URLRequest = new URLRequest(deadURL); private var deadLoader:Loader = new Loader();[code].....
I have one swf called main.swf which has a container movieclip that gets external swf's loaded into it.
my external swf is called hosting and it calls an array of data that is loaded into a movieclip that is duplicate for each element from the database. The elements from the database are as follows:
Business Economy Power Standard
Each one of these has a button over it that when press loads information from the database into a movieclip that contains a textbox. My button code is: _root.movieclip.loadVariables("url to database");
This works flawlessly when I run the hosting.swf by itself, but when it is loaded into the contianer in the main.swf the buttons dont work. I believe that it is the _root in the button call that is causing this but I dont know how to fix it. I think the _root variable changes when hosting is loaded into the main.swf.
I have a code for a page I am using and I would like to add a background and have it resize with the screen like the rest of the page. I have created a movie button named "pic" with the image in it but I don't know how to write the code and place it in the existing AS3 code file.how to place the code like i was in 3rd grade, that would be great. Here is the existing code.
One movie, named Gallery_1, with hotpots via which external swfs are loaded into a container mc of the main timeline of the Gallery_1 movie, works perfectly by now. Via another button function the Gallery_1.swf is loaded into a container mc on the timeline of the main swf, which works alright as well, but when one then clicks the hotspots of the Gallery_1.swf one gets following error message:
There are 50 movies loaded sequentially. From Q1 thru Q29 I want to attach a particular title (mc) to the main movie and then for Q30 thru Q40 another and so on. The file is on an Learning Management Sytem so I'm using SCORM [code]...