UIloader problem
Hello I have a problem with translation of a page. I have a website that has a UIloader that loads main page and I have a button that loads same website but translated(it's just a small website). I added another UIloader to my main swf but is there a way i can unload the whole site and load translated one. The only thing I've done so far is I disabled autoLoad option of that second Uiloader and enable it when the button is pressed. I would like to find a way i could access my main page UIloader and try to unload the thing. Some tutorial do show how to unload but they are unloading just a portion of the mc but not the whole page. Please help
Thank You.
again, you can unload anything that's loaded. so, if everything (other than your background) is loaded yes, you can unload everything.
objects that are not loaded can be removed from the display using removeChild().
Similar Messages
-
UILoader Component's coordinate( Movement) problem
Hi All
In my program I am allowing user to drag and drop Video
thumbnails on the main stage. The UIComponent is loading external
SWF as soon as user drops video on the main screen. Also the user
can successfully drag and drop the opened video pane (which is
UILoader Component) wherever he wants on the screen.
My problem is that when user drop the UIComponent on the main
screen, the dropped UIComponenet moves little bit from the mouse
position.
I used the code that on
stopDrag,UILoader.move(MouseX,MouseY). But it did not work
because the stage is taking UILoader's top left corner as MouseX
and MouseY and move UILoader's top left corner to the cursor
position. I came up with tricky solution in which I use on
stopDrag,UILoader.move(MouseX-200,MouseY-200). This solution
was little better in my case but that's not exactly what i want
because this solution is giving inconsistent and inaccurate
results.
Does anyone has better solution? I just need that if user
stops dragging the UILoader Component , the Component should be
placed on the coordinates wherever he/she left the mouse cursor.
I will appreciate any kind of help
Thanks a lot.
AnujDear Jeevan,
I assign one operation to external processing by control Key - PP02.
When i create production order , PR is generated for the external operation.
In this when , i see COOIS report at component level , qty withdrawn shown as zero.
But when i relesae PR to PO for the external opertaion , there is qty shown in qty withdrawn column ( Same as qty required ) ?? in COOIS report.
But i have not issue any qty, than why there is qty shown in qty withdrawn column.
Regards
Vin -
Problem with XML loading and xmlns
I'm having a problem with loading an XML file that was created by Filemaker. Filemaker will output an XML file using one of two different grammars. One outputs in a mostly standard form that I can use with one glitch. Flash CS4 AS3 seems to have a problem with the xmlns in one of the nodes.
Specifically:
<FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult">
If I remove the xmlns="http://www.filemaker.com/fmpdsoresult" the file loads properly and I can access the various fields with no problem. However, when I leave the xmlns=... in, it will trace out the XML properly but I can't access the fields using the code listed below. This is driving me crazy!
With the xmlns part in the XML file I get the following error when it tries to load the thumbnail files:
TypeError: Error #1010: A term is undefined and has no properties.
I need to have it so that the user can enter/edit data and simply output the XML file from Filemaker and then Flash will load up the unaltered XML file and show the info requested by the user. That is to say I could have the user open the XML file in a word processing application and have them delete the xmlns..., but that is rather cumbersome and not very user friendly.
I've tried every xml.ignore function I could find but it doesn't help. Hopefully someone out there can help
Thanks,
-Mark-
Partial XML:
XML From Filemaker Export:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This grammar has been deprecated - use FMPXMLRESULT instead -->
<FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult">
<ERRORCODE>0</ERRORCODE>
<DATABASE>Sport.fp7</DATABASE>
<LAYOUT></LAYOUT>
<ROW MODID="1" RECORDID="1">
<FirstName>Mark</FirstName>
<LastName>Fowle</LastName>
<Sport>Sailing</Sport>
<Medal>None</Medal>
<CourseOfStudy>Design</CourseOfStudy>
<Year>1976-1978</Year>
<HomeState>California</HomeState>
<ImageName>93</ImageName>
</ROW>
</FMPDSORESULT>
AS3 Code:
import fl.containers.UILoader;
var aPhoto:Array=new Array(ldPhoto_0,ldPhoto_1,ldPhoto_2,ldPhoto_3,ldPhoto_4,ldPhoto_5);
var toSet:int=10;//time out set time
var toTime:int=toSet;
var photoPerPage:int=6;
var fromPos:int=photoPerPage;
var imgNum:Number;
//var subjectURL:URLRequest=new URLRequest("testData_FM8.xml");
var subjectURL:URLRequest=new URLRequest("Sports.xml");
var xmlLoader:URLLoader=new URLLoader(subjectURL);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
var subjectXML:XML = new XML();
subjectXML.ignoreWhitespace=true;
subjectXML.ignoreComments=true;
subjectXML.ignoreProcessingInstructions=true;
function xmlLoaded(evt:Event):void {
subjectXML=XML(xmlLoader.data);
if (root.loaderInfo.bytesTotal==root.loaderInfo.bytesLoaded) {
removeEventListener(Event.ENTER_FRAME, xmlLoaded);
trace("XML Data File Loaded");
trace(subjectXML);
} else {
trace("File not Found");
imgNum=2;//subjectXML.ROW.length;
trace(subjectXML);
loadThumb(0);
function loadThumb(startPos:int):void {
var count:Number=aPhoto.length;
trace(subjectXML.DATABASE);
for (var i=0; i<count; i++) {
try{
aPhoto[i].source="images/"+subjectXML.ROW[startPos+i].ImageName+"_main.jpg";
}catch (e:Error){
trace(e);
aPhoto[i].mouseChildren=false;
aPhoto[i].addEventListener(MouseEvent.MOUSE_DOWN, onThumbClick);
trace("Current mem: " + System.totalMemory);
ldAttract.visible=false;
function unloadThumb():void {
var count:Number=aPhoto.length;
for (var i=0; i<count; i++) {
aPhoto[i].unload();
aPhoto[i].removeEventListener(MouseEvent.MOUSE_DOWN, onThumbClick);
trace("Current mem: " + System.totalMemory);
function onThumbClick(evt:MouseEvent) {
var i:Number;
//trace("Thumbnail Clicked " + evt.target.name);
i=findPos(evt.target.name);
ldLrgPhoto.source="images/"+subjectXML.ROW[i+fromPos].LOCAL_OBJECT_ID+"_main.jpg";
ldLrgPhoto.visible=true;
btnPrev.visible=false;
btnNext.visible=false;
gotoAndStop("showPhoto");
function findPos(thumb:String):Number {
var pos:Number;
var count:Number=aPhoto.length;
for (var i:Number=0; i<count; i++) {
if (thumb==aPhoto[i].name) {
pos=i;
return pos;Hi,
I was trying to use xml namespaces, so in my application I receive an XML file from the server. The file has a namespace, so when I parse the file I need to specify the namespace:
I got the following piece of xml:
<ls:exchange xmlns:ls=".../tsw" xmlns:tm="http://kxa">
<ls:projects>
<tm:annotation id="" date="" action="getprojects" status="responseok"/>
<ls:project id="" name="proj" description="..." owner="asss" release="2" />
<ls:projectV id="" version="" creationdate="" modificationdate=""/ >
</ls:project>
</ls:projects>
</ls:exchange>
and the following code
<mx:VBox label="WELCOME" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Tree id="tree" dataProvider="{srv.lastResult.project}" labelField="@name" width="300" height="100%" itemOpen="itemOpenEvt(event);" />
</mx:VBox>
So i want to display the content of the xml (project nodes”) in a tree view, but i don’t know how to includes the namespace"ls:" in the data provider “srv.lastResult.project”. can u help me it’s urgent.
sincerly
Celine -
Problem: Photo Gallery not working.
Hello i am new at flash. I created a simple photo gallery
using flash CS3. I had 11 photos to show and i created 11 keyframes
and put a uiloader on each one of them. Then i added buttons and
linled them to the uiloaders. I changed the source values of the
loaders. So when i clicked a button, the selected uiloader with the
photo attached to the source of it was seen. It has such a simple
logic. Because i don't know enough actionscript to do it easier.
Anyway the problem is i make it work on my computer but when i
uploaded it to my site it doesn't work properly. I can see the
buttons but the photos are not seen. I checked the files and
folders but everything seems right. What might be the problem. How
can i solve it?Try duplicating the folder structure of your website, on your
local drive. You may need the path from where the html file is, so
you would add "/mages" to the loaders for instance. Not sure what
you setup is, but I have found that using LoadMovie, I have to set
it up so it doesnt work when I test the movie in Flash, but it will
work when I open the html file... -
I am trying to write a swf that has a variety of buttons to select another swf to load in. One of the SWFs to be loaded contains a list component that has been formated using the StyleManager. The results look good in that SWF; however, when it gets loaded into the parent SWF, all of the buttons in the parent SWF get reformatted. If I drop the StyleManager from the SWF (loaded SWF) and use the following code, nothing gets formatted.
var tf:TextFormat = new TextFormat();
tf.font = "Verdana";
tf.size = 12;
tf.bold = true;
tf.color = 0xcccccc;
vidList.setStyle("textFormat", tf);Before I reply, let me just add your summary of the situation so far in an email to myself:
If you
successfully style on or components in a SWF and then load that SWF into a
parent SWF that contains only a UILoader sized the same as the first SWF and its
source set to the first SWF, all formatting is lost as well as the text that
would have appeared in those components.
It seems to me this isn't a problem with styling, its a problem with font embedding.
From my testing I've found that components in the loaded SWF only lose their font if there is a UIComponent in the parent.
I haven't been able to find documentation to confirm my theory, but I believe that once the parent has a UI Component it then tries to handle global Fonts, and doesn't immediately have access to Fonts embedded in SWFs it loads. To check this you can actually embed the same font with the same class name into the parent, and you'll find that the font starts working in the loaded SWF.
This isn't ideal in all situations though - sometimes you want the loaded SWF to handle the font embedding for itself. It appears as though if you register the Font in the loaded SWF, this adds the font to the global register that the parent SWF has access to, and this is all that is required for your font to appear.
Font.registerFont(ComicSans); -
How to create two UILoader that can be nested with each other and save the parent UILoader - as3
Hi all,
I am currently researching on the problem but I can't find any solution in the web.
Here is my problem:
I have two UILoader instance (loader_inner and loader_outer) I need to have loader_inner to be part of the loader_outer. I have also a button that will save all contents on loader_outer. Unluckily, when I trigger the save function, I only got a white image file. I was expecting that the contents of loader_outer (with loader_inner) to be saved also.
Note: background_1.jpg and rabbit.jpg are present in the directory. loader_outer and loader_inner where manually placed in the scene using UILoader component.
Here is a code snippet:
loader_inner.load(new URLRequest("background_1.jpg"));
loader_outer.load(new URLRequest("rabbit.jpg"));
loader_outer.addChild(loader_inner);
var bitmapData:BitmapData = new BitmapData(loader_outer.width,loader_outer.height);
bitmapData.draw(loader_outer);
var jpgencoder:JPGEncoder = new JPGEncoder(100);
var mybyte:ByteArray = jpgencoder.encode(bitmapData);
var myfile:FileReference = new FileReference();
myfile.save(mybyte,"test.jpg");
My expected output should be that background_1.jpg and rabbit.jpg should be saved in an image file and must be positioned like the ones placed in the scene.
Any ideas on this?
Thanks ahead.the load method is asynchronous so you don't want to apply that draw method until both loads are complete. ie, use a complete listener:
loader_inner.addEventListener(Event.COMPLETE.loadcompleteF);
loader_outer.addEventListener(Event.COMPLETE,loadcompleteF);
var loadNum:int=0;
loader_inner.load(new URLRequest("background_1.jpg"));
loader_outer.load(new URLRequest("rabbit.jpg"));
loader_outer.addChild(loader_inner);
// you should declare these variables outside this function so there are no gc issues.
function loadcompleteF(e:Event):void{
loadNum++;
if(loadNum==2){
var bitmapData:BitmapData = new BitmapData(loader_outer.width,loader_outer.height);
bitmapData.draw(loader_outer);
var jpgencoder:JPGEncoder = new JPGEncoder(100);
var mybyte:ByteArray = jpgencoder.encode(bitmapData);
var myfile:FileReference = new FileReference();
myfile.save(mybyte,"test.jpg"); -
UILoader.content stays null after load
I've started with a new Flash file and wanted to toy around with loading images and resizing the UILoader to the size of the loaded image. I've added a UILoader (instance name: loadImage) component to the main timeline and added the following code in the Actions window:
loadImage.source = "bookmark.png";
trace( loadImage.content );
The image displays properly after compiling and viewing the SWF. However, loadImage.content returns null, instead of the DisplayObject that contains the image. This way, trying to resize the UIloader according to the loaded image doesn't work, since I can't access variables of an object that hasn't been initialized.
All the documentation states that loadImage.content should contain the DisplayObject that's loaded after setting loadImage.source or using loadImage.load( new URLRequest( "bookmark.png" ) ) (which also has the same problem). So I'm stumped.
Can anyone help me out?The content is only defined when the loading has completed, which you need to set up an event listener to detect.
loadImage.source = "bookmark.png";
loadImage.addEventListener(Event.COMPLETE,imageLoadListener);
function imageLoadListener(e:Event):void{
trace( loadImage.content );
loading from an external source is 'asynchronous' which basically means actionscript continues to execute while its happening. You need to set up listeners to run when events happen for the asynchronous calls you make (in this case, setting the source property does that too, with autoLoad defaulting to true). -
Anyone know how to dynamically change the border of UILoader Component
Hi All
I am loading multiple instances of UI loader containing
external SWFs on my stage. When user double clicks on the video
thumbnail, an instance of UIloader will be placed on the main
stage.The user can place as many UIloader instances on the main
stage. My aim is that if user puts any UIloader on top of already
existed UIloader, the existed loader will be replaced with the
placed loader. I am successful in implementing that by using
hitTestObject method for that. I am planning to provide enough
feedback to the user for this UIloader replacement process, so i
was thinking to change the border of the UIloader as soon as the
dragged UIloader hits the already existed UIloader.
Does anyone know how would I animate UIloader to give enough
feedback to the user that it is being replaced. Creating an
invisible movie and moving it wherever UIloader goes doesn't sound
much efficient.
Please help me out in figuring out this problem. Also
if anyone has better idea to give enough feedback to user, that
will also be welcome. Just to be little clear i have provided
little pseudo-code(below) of what i am doing here.
Any help will be highly appreciated.
Thanks
Anuj
/***************Abstract Pseudo code for my
problem*****************/
myUILoader.startDrag();
//Putting video on top of already existed videos
var trackChild:Number=container.getChildIndex(myUILoader);
var childContainer:DisplayObject=
container.getChildAt(trackChild);
for( var z:Number=0;z<=container.numChildren-1;z++)
var restChild:DisplayObject=container.getChildAt(z);
if(childContainer!=restChild)
if((childContainer.hitTestObject(restChild))==true)
//Show Animation during replacement
//how would i give feedback here
container.removeChild(restChild);What is a Lopp Browser?
A typo I meant Loop Browser, sorry. On your iPad you can see the iTunes Library in the Loop Browser:
Open the Loop Browser
Tap the Loop Browser button in the control bar. The Loop Browser button is available only in Tracks view.The first time you open the Loop Browser, it shows the Instrument grid.
I was told by a sales person at the Apple Store at one of my One-on-One sessions, that Mac would not transpose nor change tempo because my "live music" was not a "midi" file.
GarageBand 10.0 will change the pitch and tempo of live recordings - midi as well as audio instruments, but not of audio files. But you need to enable the "Follow tempo and pitch" option in the track editor.
Then you can transpose the region using the "Transpose" slider.
And if you change the project tempo in the LED display after you enabled "Follow Tempo&Pitch" the recording will follow the new tempo.
You can test this with a new project created on your mac. -
Make pictures fade-in to eachother using UIloader
I have a problem making pictures fade into each other.
I have a gallery using UIloader. the problem is that when I press the next_btn the prev pic dissapears during the upcoming loads.
I really appreciate help on this one!
cheers!
this is my code:
bcn_next_btn.addEventListener(MouseEvent.CLICK, nextImage);
import fl.transitions.Tween;
import fl.transitions.easing.*;
//variable is a container that holds som value.....
var imageNumber:Number = 1;
function checkNumber(): void{
bcn_next_btn.visible=true;
bcn_back_btn.visible=true;
//it the imagenumber is = 5 then do something
if (imageNumber==3){
trace(imageNumber);
bcn_next_btn.visible = false
// if the imagenumber is = 1 then dont show the backbtn
if(imageNumber==1){
trace(imageNumber);
bcn_back_btn.visible = false;
checkNumber();
function nextImage(evtObj:MouseEvent):void
imageNumber++;
LargeImageLoader.source = "image/emma/emma_"+imageNumber+".jpg";
checkNumber();
bcn_back_btn.addEventListener(MouseEvent.CLICK, backImage);
function backImage(evtObj:MouseEvent):void
imageNumber--;
LargeImageLoader.source = "image/emma/emma_"+imageNumber+".jpg";
checkNumber();
LargeImageLoader.addEventListener(Event.COMPLETE, ImageLoaded);
function ImageLoaded(event:Event){
new Tween(LargeImageLoader,"alpha",Regular.easeOut,0,1,2,true);
progressBar.source=LargeImageLoader,
progressBar.addEventListener(ProgressEvent.PROGRESS,progressHandler);
progressBar.addEventListener(Event.COMPLETE,completeHandler);
function progressHandler (event:ProgressEvent):void{
function completeHandler (event:Event):void{thx for your reply!
Ait... two loaders how do I do that....?
I am pretty new to this world..
cheers! -
Ok this is my first time useing a forum but I have run into a problem and really need some help dont know if this is where I'm suppose to post it.Here it is building a web site with Flash cs4 and useing a UIloader to bring in my photos and it keeps giving me an error saying ///C |/users/J%/Documents/web%5Fsite/assets/images/portfolio1.jpg URL file not found. The FLA file sits in the same folder I have never had a problem til today. I have checked the UI inspector and made sure the source was right and it was, here is the catch if I rename a photo to a name without numbers then it see's it but only a few of them???? I need to load 20 of them i'm at my wits end cause this doesn't make any sense to me at all I'm not a Flash master or anything but I know my way around the program to get what I want done,til now. So if someone could please tell me what is wrong that be great
What code are you using for the loading? What do you use to identify the images that are to be loaded? What are the names of the images you are loading? For what you say happens when you remove the number (not sure from where) indicates to me that there is a disconnect in the naming of things.
As added info only: If this is eventiually going to be online, if the html file that will display the Flash is not in the same folder as the Flash file and images, you will need to adjust the targeting in the Flash file to be relative to where the html file lives. So if the html file is in the main site folder, and the Flash and images are in an images folder, the images need to be specified using that folder name. -
UILoader doesn't display initial source images online
I'm using two UILoaders to display a bunch of photos and to speed up the load time of this website:
www.miamispringspharmacy.com
When the "Jewelry" link is clicked, the section comes up but without any photos. The "next" arrow button works and when clicked, the images appear as they should. But no matter what, the first two images do not show up. One loader is set to display "1.jpg" from one source file and the other loader is set to display "1.jpg" from a second source file. I don't think it's a matter of an incorrect link pointing to the source files because the rest of the images appear. The swf file works perfectly locally, and I only have this problem when publishing on the web.
I appreciate any suggestions.
Thanks,
DanaI'm stil woking on this one,
http://www.buckleyphotos.com/wsp5706/source/image/showpic.php?num=1&showpic=21_71909_6487. jpg&el=2009-07-19+NEMX+Crow+Hill&riderno=21
Here's the PHP code
<?php
$page = $_GET['num'];
$el = urlencode($_GET["el"]);
$riderno = $_GET["riderno"];
$showPic = strtolower($_GET["showpic"]);
echo "$showPic";
?>
You can see the file name of the photo above the light gray SWF, that's the result of the PHP query, echo "showPic"
This is the AS 3 code:
import fl.containers.UILoader;
var loader:UILoader = new UILoader();
loader.scaleContent = false;
loader.source = "showPic";
addChild(loader);
This is the HTML:
<param name="movie" value="http://www.buckleyphotos.com/wsp5706/source/image/Main2.swf">
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="6.0.65.0">
<param name="expressinstall" value="../Scripts/expressInstall.swf">
<param name="allowScriptAccess" value="always">
<param name="loader.source" value="$showPic"> -
Scripting the loading bar without a UILoader...
So I was using a UILoader to load my swf, but was having issues with the component, so I got rid of it, and am now using the following AS to load the file instead:
var Xpos:Number=0;
var Ypos:Number=0;
var swf:MovieClip;
var loader:Loader=new Loader();
var defaultSWF:URLRequest=new URLRequest("CMO.swf");
loader.load(defaultSWF);
loader.x=Xpos;
loader.y=Ypos;
addChild(loader);
My problem however, is that before when I was using a UILoader component, I had some dynamic text and a little animation running while the clip loaded and I need to rescript it to work without the UILoader component. The AS I had for that was worked into the UILoader instance name:
loadFile();
loadAnimation.stop();
function loadFile():void {
CMOLoader.load(new URLRequest("CMO.swf"));
CMOLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
CMOLoader.addEventListener(Event.COMPLETE, completeHandler);
function progressHandler(e:ProgressEvent):void {
prog_txt.visible=true;
var percent:int=CMOLoader.percentLoaded;
prog_txt.text=percent+"%";
function completeHandler(event:Event):void {
currentFrame+1;
prog_txt.visible=false;
loadAnimation.visible=false;
CMOLoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
CMOLoader.removeEventListener(Event.COMPLETE, completeHandler);
So now I'm trying to figure out how to extract and rescript the animation (loadAnimation) and the text (prog_txt) to fit my new AS that loads the file now.
Thank you for any ideas!oops. that should be:
kglad wrote:
var Xpos:Number=0;
var Ypos:Number=0;
var swf:MovieClip;
var loader:Loader=new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressHandler );
var defaultSWF:URLRequest=new URLRequest("CMO.swf");
loader.load(defaultSWF);
loader.x=Xpos;
loader.y=Ypos;
addChild(loader);
CMOLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
function progressHandler(e:ProgressEvent):void {
prog_txt.visible=true;
var percent:int=Math.round(100*e.bytesLoaded/e.bytesTotal);
prog_txt.text=percent+"%";
function completeHandler(event:Event):void {
currentFrame+1;
prog_txt.visible=false;
loadAnimation.visible=false;
// remove the above listeners
CMOLoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
CMOLoader.removeEventListener(Event.COMPLETE, completeHandler); -
How to print a Movie clip inside uiLoader?
Hi,
I;m making a flash application in AS3, and I've got a little problem.
Which is here...
Here is my code....
/* Print Button Function Here.....*/
print_btn.addEventListener(MouseEvent.CLICK,printPage);
function printPage(evt:MouseEvent) {
var printJob:PrintJob = new PrintJob();
if (printJob.start()) {
if (uiLoader.source.width>printJob.pageWidth) {
uiLoader.source.width=printJob.pageWidth;
uiLoader.source.scaleY=uiLoader.source.scaleX;
printJob.addPage(uiLoader.source); <------------ Error shows Here
printJob.send();
Actually I have a movie clip which contains a Print Button and a uiloader.
uiloader loads differnt external movies.
I applied a code to Print button to print those movies.
But FlashProgram shows an error.
which is Here....
Scene 1, Layer 'Actions', Frame 2, Line 174
1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:Sprite.
Please tell me how to fix it.
thank you...Thank you very much it's been really helpfull.
Now it's working but there are two more issues which i want to dicuss now.
1st issue is, it print the both movies (main movie & external both) but i only want to print that one which inside the uiloader only.
2nd issue is, actually this application which I'm making is for users to apply various paints on roofs and walls to check how they looks.
The issue is it only print the actual movie colors not those colors which have been currently applied. Or what i'm trying to say is that, " how can I print uiloader source movie with it's current colors settings?"
thank you. -
Hello,
After many different forum searches, I still can't find the
answer to my newbie problem when using Flash CS3.
I'm trying to use the UILoader component that creates an
empty container into which I want to load an external swf file.
Without using AS, in the parameter box for the "container" placed
on the stage of my main movie, I specify the name of the file I
want to load (box.swf). Upon testing the movie, two problems occur.
First, I can't figure out how to ensure that displayed
position the loaded swf is centered on the stage. I've tried moving
the container such that it's lower right corner sits on the stage's
spot where I want the UL corner of the swf to play, but no joy.
Secondly, instead of placing the external swf inside of the
container and scaling it appropriately, the loaded swf (as
mentioned previously) loads outside of the container's position,
and cuts off a portion of the swf. I've tried ensuring that the
container is the same size as the swf (or even bigger), but again
to no avail.
Can someone please point out what I must be doing wrong? The
external swf plays well on its own and simply represents a motion
tween of a box growing in size and changing shape over the course
of 20 or so frames.
Thanks in advance for any assistance!
TextThanks for your fast response, dzedward.
Here goes...I hope you'll bear with me. Since I don't know
what type of background info you need, I'll explain in detail.
Background:
I'm creating a flash presentation that we can display on a
large monitor at a tradeshow. The presentation will simply play
from a connected laptop and loop, without the need for user
navigation (no buttons). This is my first time creating such a long
file (I anticipate that this will play for 3-4 minutes straight) so
I thought it would be best if the main timeline were to call and
load successive smaller, stand-alone swfs at selected times, based
as the playhead moves through the timeline in a single pass. I'd be
able to minimize the size of the main file in this way.
Trouble Using AS3:
As a newbie, I don't have much experience with AS3. Using an
AS3 script found online I've been able to load a single swf into
the timeline of my main movie successfully, but when I try to load
another later on in the main timeline, neither swf plays....most of
the scripts and forum answers I've come across over this past few
days deal with AS2 or earlier versions, so I can't use or learn
from them.
Using the UILoader Widget:
Thats when I saw reference to using Flash CS3's UILoader
Component for this purpose (accessed via Window>Components
menu). What it does is create an empty container into which you can
load an external swf, jpg, or png file. You first simply drag and
drop the widget onto the stage from the component window. Then,
from the container's property window, you choose its dimensions and
placement on the stage. Via the container's parameter window you
tell it whether to autoload the content, maintain aspect ratio,
and/or scale the content, as well as provide the name of the source
file you want to load. It seems pretty simple - even I can do it
and can get it to work when I load a jpg or selected swf file. Upon
testing the movie, the jpg or swf plays back INSIDE the container,
scaled down or up based on the container's size as it relates to
that of the source file. So far so good.
You'll see from this widget that you only need to specify
"true" or "false" for the autoload, maintain aspect, and scale
content questions. I've done this inside the widget as I'm not sure
how to accomplish this with the scaleContent and scaleAspectRatio
parameters you mention using actionscript.
Problem When Using UILoader Widget:
Here's the problem I'm having. As I mentioned, I've created a
short 20-frame animation output to swf showing a white box that
grows in size and changes shape against a black background, using
the same frame rate (30fps)_and dimensions as my main movie. The
animation is a simple shape tween, with no actionscript other than
a stop ( ) ; placed on the last frame of an actionscript layer to
prevent looping. It plays as desired on it's own. However, when I
load it into the UILoader container that is centered on the stage
of my main timeline and then test the movie, two problems occur.
Firstly, the animation does not play inside the container;
instead, the upper left corner of the loaded swf animation shows up
where the lower right corner of the container showed up on the
stage (hence I only see one corner of the animation). Secondly, the
animation is cropped; the visible outer edges of the morphing white
box are cut off meaning that I lose the visual effect of the shape
tween.
I saw reference online elsewhere to the possible need to
position the container on the stage such that it's lower right
corner is where you want the upper left corner of the animation to
be placed, but this doesn't make sense to me (it's likely that I
misunderstood what I read). I did try this however, and while doing
so allowed me to more correctly center the external animation
within the main movie, it's edges are still cropped. To me it
should have been placed inside of the container and scaled.
I'd love to be able to do this using actionscript 3.0, but
I'm having even more trouble with this and haven't found any
comparable tutorials or forums explaining how to load and unload
multiple swfs into a main timeline without the need to control
using buttons or a mouse. I'd like to be able to specify on the
main timeline when a particular swf is played, then do so again
later on in the same timeline with another swf file, and so on.....
I don't know if this explanation will make anymore sense. I
could send you the fla or even screenshots showing what I see
during playback of the short animation inside of my main flash file
you can provide me with your address and feel that it would help.
It looks like I can only post code from this forum.
Thanks for reading through this and for your possible help! -
How to communicate a button to a movie_clip inside of UiLoader component using AS3?
Hi, i'm making a flash application to test various paints, for a company.
I have movie clip on stage having some buttons on left side and a uiloader on other side which loads an external swf file on button(thumb_01) click-target. In main movie clip there are two buttons. 1 trigger a function to select a wall and 2nd trigger a function to select roof. External swf(movie_01.swf) file has two movie clips 1 is a wall(mask_01) and 2nd is roof(mask_02). Now the problem is i want to click a button to select wall inside of external swf file to change it's color. I'm sure that the problem is in path through which i'm trying to select a wall movie which is inside of UiLoader. Can any one tell me What'll be the path to trigger a function to a movie clip inside of Uiloader?
Here is my code for Button to select a wall or roof ==================================
import flash.events.MouseEvent;
import fl.motion.MotionEvent;
var targetObj:Object;
selectWall_btn.addEventListener(MouseE… selectWall);
function selectWall(evt:MouseEvent):void {
targetObj = uiloader.movie_01.mask_01; <--------- I think problem is in this path....
trace ("Wall is selected!");
Here is code for uiloader ========================================…
import fl.containers.UILoader;
Object(this).slider_mc.thumb_01.addEve… loadMovie_01);
function loadMovie_01(evt:MouseEvent):void {
trace ("Movie is Loading!");
var uiLoader:UILoader = new UILoader();
uiLoader.source = "movies/movie_01.swf";
uiLoader.scaleContent = false;
uiLoader.x = 291;
uiLoader.y = 19;
addChild(uiLoader);
uiLoader.addEventListener(Event.COMPLE… completeHandler);
function completeHandler(event:Event) {
trace("Number of bytes loaded: " + uiLoader.bytesLoaded);
Error is this....
Scene 1, Layer 'ActionsScript', Frame 1, Line 43
1120: Access of undefined property uiLoader.
Can any one Help me?PArt of the problem will be due to declaring the uiLoader inside of a function. When you do that you limit its scope to within that function. You should declare it outside of any function if you need to access it in more than one function.
import flash.events.MouseEvent;
import fl.motion.MotionEvent;
var uiLoader:UILoader;
var targetObj:Object;
The other problems I see regard the line you point to. It is not spelling the name the same, using a lowercase "l". Also, if you want to target what the UILoader contains, you should target its "content" property, as in...
targetObj = uiLoader.content.mask_01
Maybe you are looking for
-
BI Content TAB Missing in RSA1
I have installed BI Content 703 SP9 but the BI Content tab is missing in the RSA1
-
EHP5 Upgrade - Getting error in MAIN_NEWBAS/STARTSAP_NBAS
Checks after phase MAIN_NEWBAS/STARTSAP_NBAS were negative! Last error code set: RFC call to subst_get_uvers failed with key RFC_ERROR_SYSTEM_FAILURE (open): SAP_CMINIT3 : rc=20 > Connect to SAP gateway failed Connect_PM GWHOST=accagtci, GWSERV=sapgw
-
"Reset sync history" does not work
I am trying to fix an issue where my iPhone no longer syncs to my outlook 2007. Many posts suggest resetting sync history in iTunes, but when I click on "reset sync history", absolutely nothing happens. Something is broken. All suggestions welcome.
-
Strange JPEG export from CS4 (6.0)
When I export jpeg from InDesign, the resulting jpegs only open in Photoshop. When trying to import to InDesign, place pane shows them grayed out. I had this same issue back in CS3, which was fixed on an update, but now it's here again?
-
Help with backing up...
Hey all, i'm going to be exchanging my MBP 13" Intel Dual Core 2 2.4Ghz tomorrow for the new i5 13" (30 day money back guarantee even if opened, tomorrow is the last day!) and I really want to just back it up and transfer everything as smoothly as po