Casting Loader.content
Hi,
I am trying to dynamically load swf-files. They extend a class TestClass. However, using Loader, flash always considers loader.content as MovieClip, leading to the methods and properties defined in TestClass not being available.
Casting does not seem to work.
Am I taking the wrong approach?
Cheers, jt
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 05-22-2008, 11:08 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Casting LoaderInfo.content (.swf File) To Its Document Class Causes Compilel Err 1180
I have a Flash file (Foo.fla) with a document class Foo that has a movieclip in its library named Bar that is linked to a class Bar (generated bij Flash). The Foo constructor:
Code:
public function Foo() {
addChild(new Bar());
}
Foo.fla compiles to Foo.swf and runs with no errors. Now from a different Flash file (Test.fla) with a document class Test I want to load Foo.swf using the flash.display.Loader class:
Code:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
loader.load(new URLRequest("Foo.swf"));
In the event handler I get a compile error for Foo.as (the document class for Foo.swf) when I try to cast the content property of the contentLoaderInfo object to an instance of Foo.
Code:
private function onLoad(e:Event):void {
var loaderInfo:LoaderInfo = e.target as LoaderInfo;
loaderInfo.content as Foo; // Cause a compile error in Foo.as
}
Quote:
Foo.as, Line 6
1180: Call to a possibly undefined method ProgressBar.
addChild(new Bar());
Foo.as compiles without errors but Test.as causes a compile error in Foo.as which is unexpected.
Why is this happening and what can I do to prevent it?
Thank you!
External Content Loader With Multiple Content Types (trouble Loading Graphics)
Hey all!
I am yet another new project. Our flash designer here isn't a big AS guy, and asked me to write a reusable class so that he can load a variety of content types using minimal amount of code on his part. It's also going to be the main component piece in a larger external content player once I'm done with the class itself, so I am making the loading functions into public methods of the loader object than can be called from a button, etc.
I have the code for the text and html parts working (although I can't get stage.width and stage.height to work in the class or from the frame).
The problem I have is that I can't get the graphics content to load (the swf/pic content). Could you please check my code and tell me what I'm missing? I'm sure it's something simple, like it always is.
thanks a million!
-Fish
-----------------------------
ActionScript Code:
package
{
/**
* External Multimedia Loader Class
* @author $(DefaultUser)
* Add new MultiLoader object and insert media type (all lowercase) and object path to control initial loaded object
* To load a new object, call the MultiLoader.load* methods (loadText, loadPic, loadSwf, or loadHtml as appropriate), passing the path to the external file.
*/
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
public class MultiLoader extends MovieClip
{
private var media:String;
private var path:String;
public var textObj:TextField = new TextField;
public var picObj:MovieClip = new MovieClip;
public var swfObj:MovieClip = new MovieClip;
public var htmlObj:TextField = new TextField;
private var objLoader:Loader = new Loader();
private var objType:String;
private var textLoader:URLLoader = new URLLoader();
public function MultiLoader(mediaType:String,objPath:String)
{
media = mediaType;
path = objPath;
if (media == "text" || media == "TEXT" || media == "Text")
{
loadText(objPath);
}
else if (media == "pic" || media == "PIC" || media == "Pic")
{
loadPic(objPath);
}
else if (media == "swf" || media == "SWF" || media == "Swf")
{
loadSwf(objPath);
}
else if (media == "html" || media == "HTML" || media == "Html")
{
loadHtml(objPath);
}
else
{
trace("ERROR: Media type not supported. Media type must be 'text', 'pic', 'swf', or 'html'.");
}
}
public function loadText(txtPath):void
{
objType = "text";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(textObj);
this.textLoader.load(new URLRequest(txtPath));
this.textObj.wordWrap = true;
this.textObj.multiline = true;
this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
//this.textObj.width = this.width;
//this.textObj.height = this.height;
}
public function loadPic(picPath):void
{
trace("loadPic started");
objType = "pic";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(picObj);
this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
this.objLoader.load(new URLRequest(picPath));
trace("loadPic completed");
}
public function loadSwf(swfPath):void
{
trace("loadSwf started");
objType = "swf";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(swfObj);
this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
this.objLoader.load(new URLRequest(swfPath));
trace("loadSwf completed");
}
public function loadHtml(htmlPath):void
{
objType = "html";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(htmlObj);
this.textLoader.load(new URLRequest(htmlPath));
this.htmlObj.wordWrap = true;
this.htmlObj.multiline = true;
this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
}
private function removeAllChildren():void
{
if (objType == "pic")
{
this.picObj.removeChild(objLoader);
}
else if (objType== "swf")
{
this.swfObj.removeChild(objLoader);
}
else
{
trace("objType != 'pic' or 'swf.' objType = '" + objType + "'.");
}
while ( this.numChildren > 0 )
{
this.removeChildAt(0);
}
}
private function addObjLoader(event:Event):void
{
trace("addObjLoader started");
if (objType == "pic")
{
trace("trying to load pic");
this.picObj.addChild(this.objLoader);
this.picObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
}
else if (objType== "swf")
{
trace("trying to load swf");
this.swfObj.addChild(this.objLoader);
this.swfObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
}
else
{
trace("ERROR: Cannot add object loader. The 'objType' variable does not contain correct media type. The function 'addObjLoader' should only be called when objType is 'pic' or 'swf'. In this case, objType is '" + objType + "' .");
}
trace("addObjLoader completed");
}
private function addTextContent(event:Event):void
{
if (objType == "text")
{
this.textObj.text = event.target.data as String;
this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
}
else if (objType == "html")
{
this.htmlObj.htmlText = event.target.data as String;
this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
}
else
{
trace("ERROR: Cannot add text content. The 'objType' variable does not contain correct media type. The function 'addTextContent' should only be called when objType is 'text' or 'html'. In this case, objType is '" + objType + "' .");
}
}
}
}
AS3 Loader.content Access To Partially Loaded Content
I have a main swf that loads an external swf. The external swf is a fairly large video embeded on the timeline.
Ive got my Loader all setup correctly, handling PROGRESS, COMPLETE and INIT events all fine.
What id like to do (which i could do in AS2 very easily) is start the playing and accessing variables in the loaded swf before it finishes loading. If i do these things when the video swf is loaded completely, everything works fine.
Any attempt to access Loader.content or the container clip ive placed Loader.content in, BEFORE its finished loading (when it reachs, lets say, 20%), i get error:
#2099 The loading object is not sufficiently loaded to provide this information.
Anyone have any ideas on how it could be possible to start messing with loaded SWF content before all of its frames are loaded? Thanks in advance for lookin over my post!!
Dynamic Content Loader
Alrighty, I have a movie that loads in 3 movies for content using the loadMovieNum and those 3 movies are different per links on navi menu.
I'd like to create a preloader for each of them as each page has separate movies. sooo basically...
Navi
-Link1
--link1links.swf
--link1pics.swf
--link1text.swf
So that's pretty much how it's broken down. Now I was looking through flash mx book that came with software and reading on their site and trying to figure out a reasonable way to do a dynamic preloader where, if link1 is hit, then it goes to a generic preloader and through a string or param it picks up to load in link1 movies.
Then I thought, it also might be better to load all 3 as one instead of 3 separate ones, except the pictures are big, and they're all in the swf, they dont load in externally.
So, if anyone has any tips , links, or thoughts on how I might streamline this, I'd appreciate, till then I'll be banging my head against wall. THANKS
Playing Content In Loader
Hi
I have a loader component and I want to tell the swf file to play how do I accomplish this. I was trying
loader.content.play
Thanx
Content Loader Progress Bar
i have a content loader control in my movie clip, and it loads a random picture file when a button is pressed. it takes some time to load the file, so how do i add a progress bar to it?
[F8] Loader Content Properties
Hi again!
I have a Loader component on the stage which loads several jpegs with diferent aspect ratios. This Loader has some buttons on its side. I need these buttons to be close to the loaded jpeg, no matter its aspect ratio. Is it possible to retrive the _x position of the right side of the loaded jpeg inside a Loader component, so I can position my buttons accordingly?
Thanks!
AVM1Movie As Loader.content
Hi all,
I've seen a few posts on this issue and was just wondering if anyone has managed to find a workaround.
I have an AS3 movie which loads an older swf which Flash then treats as an AVM1Movie object. I need to be able to access the currentframe and totalframes properties of this object - which obviously I can't as it's not AS3.
Has anybody found a way to do this?
Center Content In Loader.
Afternoon ye Actionscripters...
I am having a problem centering my content in the middle of a loader I have created. The loader is 280 X 120 but the content which is loaded into my loader is not always that size.
I am not using a Component Loader.
How would I go about centering the content in my loader?
http://livethislife.primecircle.co.za/sitenew.swf
Click on the button which says, "Watch Prime Circle's music video....."
Wait for the video to download and see how it's off centre. This same preloader loads another swf in the library but centres things perfectly.
Thanks in advance..
S
Accessing Loader's Content Using XML
Hi,
I've loaded an image into a loader from an XML file. Now I need to access that image to change it's X position. How do I go about doing this?
I have used the debug to list all my objects, but my image is going to change whenever it loads a new one, so I can't use the image name...
The array which holds my images is called propertyImage and I would have thought I could do this:
_root.loader_mc.propertyImage[currentProperty]._x
but that didn't work
I've also tried this but it didn't work either:
_root.loader_mc.content._x
Thanks...
Attach Code
_root.loader_mc.content._x
Edited: 11/22/2006 at 02:56:08 AM by Picsil
How To Detect The Content Of A Loader?
I would like to create a text field for the user to input the img URL which will be put into the contentPath of a Loader.
I have a question that how to detect when the user entered a invalid URL and the loader will load the default image??
Thanks so much
Loader Content And Sequrity
I can not convert the Loader content to BitmapData, received this error:
1067: Implicit coercion of a value of type flash.display:Bitmap to an unrelated type flash.display:BitmapData.
Here is the code
var myBitmapData:BitmapData ;
var request:URLRequest = new URLRequest("test.jpg");
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);
myLoader.load(request);
addChild(myLoader);
function onLoadComplete(e:Event){
myBitmapData = Bitmap(myLoader.content) ;
}
Please help
Please Help On The Loader.content To Movieclip
Hello there,
I have been search around and got some mixed solutions, summarized as follow:
If I need to load external swf into the main swf file, I need to Loader with appropriate URLRequest for this purpose.
After loaded, you can listen to the complete event and addChild the loader.content to the main swf.
Because I have a stop on the loaded swf first frame, I need to start the swf with a button. Some solutions on the net pointed that to make this happened, you need to cast the loader.content to MovieClip and have to through a tricky way to accomplish it like
var movie:*=loader.content ;
var clip:MovieClip=movie;
clip.gotoAndPlay(4);
.....
I tried this method and still got Type Coercion failed ::cannot convert flash.display to MovieClip
Please help, don't know why some experts said it is working while I can not get it to work. Thanks in advance
From Loader To Movieclip And Other Content
Hello all!
I wonder if someone knows about this.
I have an XML-file which holds some info about picture and text.
A designer have made some mc's and I have to load the pictures (which has URL from XML) into this mc-animation.
I can only load the images into the loader and then I'm totally lost, I cant get the image from the loader in memory into the animated timeline mc. Any clue to how this is done? I have tried addChild but this doesnt help me attach the loaded picture to the anim_mc. or...?
The designer also have a textlayer, which is put in a mc and then animated. And the text from XML must go into the textfield and be animated.
any hint would be very appreciated. There must be some kind of command I don't know or have overlooked.
//Thanks
Peter
Variable For Loader Content
Is it possible to create a variable that references a loader content ?
For instance, in the example below, is it possible of having something like:
var LoaderContent:SOMETYPE = new SOMETYPE();
LoaderContent = pictLdr.content;
And then using LoaderContent variable instead ?
What type of variable should it be ?
var container:Sprite = new Sprite();
addChild(container);
var pictLdr:Loader = new Loader();
var pictURL:String = "banana.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL); pictLdr.load(pictURLReq);
pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function imgLoaded(event:Event):void
{
container.addChild(pictLdr.content);
}
Variable For Loader Content
Is it possible to create a variable that references a loader content ?
For instance, in the example below, is it possible of having something like:
var LoaderContent:SOMETYPE = new SOMETYPE();
LoaderContent = pictLdr.content;
And then using LoaderContent variable instead ?
What type of variable should it be ?
var container:Sprite = new Sprite();
addChild(container);
var pictLdr:Loader = new Loader();
var pictURL:String = "banana.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL); pictLdr.load(pictURLReq);
pictLdr.contentLoaderInfo.addEventListener(Event.C OMPLETE, imgLoaded);
function imgLoaded(event:Event):void
{
container.addChild(pictLdr.content);
}
Center Content In Loader
Last edited by SkyNarc : 2006-02-01 at 03:28.
Morning All...
I am having a problem centering my content in the middle of a loader I have created. The loader is 280 X 120 but the content which is loaded into my loader is not always that size.
I am not using a Component Loader.
How would I go about centering the content in my loader?
http://livethislife.primecircle.co.za/sitenew.swf
Click on the button which says, "Watch Prime Circle's music video....."
Wait for the video to download and see how it's off centre. This same preloader loads another swf in the library but centres things perfectly.
Thanx..
S
Access Content Of Loader
Last edited by SkyNarc : 2006-11-22 at 01:33.
Hi,
I'm loading an image into a loader from an Array which is loaded from an XML file.
Now I'm trying to change the X position of that image but cannot access it since this is the first time I am doing this.
My loader is called loader_mc and my array for the images is called propertyImage so I've tried this without much luck:
PHP Code:
_root.loader_mc.propertyImage[currentProperty]._x
Thanks..
Loader Component Content
Is there a way to access the swf that is loaded by a loader component? For example, I want the loaded swf to be stopped at first and then play when i tell it. (something like loader.content.play() )
Anybody know how to do this?
Thanks.
Loader Control Content Path
how can i set the content path to the value of a variable?
i typed in "_level0.ppath" as the content path, but then it tires to find the file, "_level0.ppath", which doesnt exist!
Center Content In Loader Component
Hi,
I am trying to create a photo gallery inside of a loader component.
Right now, the photos are going to the top left.
Any suggestions??
Thanks!
Loader Class | Smoothing Content
I have a loader class that loads a png. When that png is finished loading I start scaling the graphic back and forth. It will works fine except the graphic when scaling DOES NOT look smooth. I know how to make Bitmap objects smooth. But the Loader class instance's content property is not a bitmap. so I can't set it to smoothing = true. I need to get it smooth. Any help would be appreciated.
Code:
var loaderSamosa = new Loader();
loaderSamosa.load( new URLRequest( "__assets/pulsing_samosa.png" ) );
loaderSamosa.contentLoaderInfo.addEventListener( Event.COMPLETE, showSamosa );
addChild( loaderSamosa );
private function showSamosa( e:Event ):void {
loaderSamosa.cacheAsBitmap = true;
loaderSamosa.content.cacheAsBitmap = true;
//THIS MAKE THE SAMOSA GRAPHIC GET SMALLER AND LARGER
SpecialAnimations.pulsate( loaderSamosa, .75, true );
}
Accessing Loader Content Outside A Class
Hi there,
i wonder how to access Variables which are loaded in class from fla...
I maintain some script to load variables via URLLoader into array in class, put event listener into class...
everething work properly inside the class
My question is how to access the array outside the class when the variables are loaded. some dispatcher, or?
thx
Content Loader Referencing Problem
Hi,
I've been using the content loader on my main.as document to read param objects and it works totally fine
ActionScript Code:
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
I wanted to do the same thing but from a class other than my main one.
So in my main class I have
ActionScript Code:
getParamClass=new getParamClassr(this);
So I'm passing a reference to the main timeline (document) to the class that I now want to read the paramObj.
Then in my getParamClass I have
ActionScript Code:
var paramObj:Object = LoaderInfo(_main.root.loaderInfo).parameters;
I'm getting a compiler error saying that "1180: Call to a possibly undefined method LoaderInfo."
Could somebody help me out with the referencing. The content loader and timeline hierarchy in as3 is still a little esoteric to me
Loader Component Not Scaling Content
I am using a loader component to load an external swf into main movie. As swf plays, content that should be off stage is showing outside the box of the loader. Scale content is set to true and swf is sized down, but will not stay within loader.
Loader Componet Content Path
I have the following structure:
Root movie creates a blank movie clip inside itself.
Root moview loads an swf file (content.swf) into the blank movie clip, based on AS logic.
The content.swf's are in a folder one level down from the root movie:
root.swf
/swfs/content.swf
I need the content.swf to load jpg's from an external file.
I have the loader component in a content.swf and I know the content.swf is loading properly. AutoLoad = true for the loader component.
I've tried the following scenerios:
At the level of root.swf:
Put the image beside root.swf: image.jpg (contentPath: image.jpg)
Put the image in an images folder beside root.swf: /images/image.jpg (contentPath:image.jpg)
At the level of the swfs:
Put the image beside content.swf: /swfs/image.jpg (contentPath: image.jpg)
Put the image in an image folder beside content.swf: /swfs/images/image.jpg (contentPath: images/image.jpg)
None of these scenerios work.
Is it possible to load an image into a movieclip loadded into a blank movieclip inside a root movie? Can I use loadMovieNum? Would that work better? If so, do I do the AS in the content.swf? or the root.swf?
Thanks for your help!
Loader Component Not Displaying Content
I had this issue on a few different projects and have not been able to find a solution:
When loading an image with the loader component, the image only displays about half the time even though the complete event is received. I sometimes see a quick flicker of the image.
I have tried both calling invalidate() and resizing after loading has completed, but does not help.
Unload Content From A Loader Component
Hello Forum,
I am using the AS2 loader component. The code below is how I get things going.
import mx.controls.Loader;
var myRoot_mc:MovieClip = this;
myRoot_mc.createClassObject(mx.controls.Loader, "myLoader_ldr", myRoot_mc.getNextHighestDepth());
myRoot_mc.myLoader_ldr.scaleContent = false;
myRoot_mc.myLoader_ldr._xscale = 85;
myRoot_mc.myLoader_ldr._yscale = 85;
myRoot_mc.myLoader_ldr.contentPath = "LessonOne_skin.swf";
myRoot_mc.myLoader_ldr._x = 55;
I am trying to use the Captivate variables (rdcmnd, rdinfoSlidesInProject, etc) to control the swf that gets loaded.
This works fine for the first load.
I would like to unload the Loader, and put a different swf as content, and access the same Captivate variables on the newly loaded swf. It seems that I cannot unload content from the Loader component (tried unload, and removeMovieClip, and contentPath = "" using a buttion (onPress, or onRelease, etc).
I can load another swf in the loader using contentPath = "next_swf.swf" but cannot access any of the Captivate variables on the newly loaded swf.
Any ideas on how to do this correctly?
Thanks,
eholz1
Loader Class Access .swf Content
Hi!
I am having trouble accessing a MovieClip from a .swf file that I load in my main movie.
I use a code similar to the one bellow, and myMovieClip is a MovieClip placed directly on the stage of my .swf file.
I would apreciate a little help on this.
Thank you!
Attach Code
var loader:Loader = new Loader();
loader.loaderInfo.addEventListener(Event.COMPLETE, on LoadComplete);
funciton onLoadComplete(event:Event):void {
loader.myMovieClip.visible = false; // for example
};
loader.load(new URLRequest("mySwf.swf"));
Content Size Of UILoader Or Loader
how to get content size of UILoader or Loader and how can i resize the contents.
any positive response will be highly appreciated.
regards
maani janjua
Scaling Content In Loader Component
Hi!
I am using a loader component to dynamically load contents. Say the loaded content coming from outside is a kind of rectangle in shape and when I keep the loader shape as square (meaning that I want the contents to get displayed in the form of square shape) the contents are not exactly the shape of the loader. Can someone help me with this? Does loader component scale content only proportionally? If there is any code to load it exactly the way I want it to, can you guys let me know what to do?
Regards,
Kirthi
Scaling Content Using Loader Component
Hi!
I am using a loader component to dynamically load contents. Say the loaded content coming from outside is a kind of rectangle in shape and when I keep the loader shape as square (meaning that I want the contents to get displayed in the form of square shape) the contents are not exactly the shape of the loader. Can someone help me with this? Does loader component scale content only proportionally? If there is any code to load it exactly the way I want it to, can you guys let me know what to do?
Regards,
Kirthi
Preloader For Loader Component Content
hi there
i`m new to this. And i have a problem i`m trying to solve. I have a site made in flash and i use loader component to load different swf`s. But the swf`s are pretty large and i want to have a simple preloader to show the message "loading" and no percentage for each swf i load. I found many tutorials about that, but all are mentioning the preloader component, and i do not want to use that because i want my own made frames in the preload animation (like the logo of my site for example). Can anyone help me on that, or point me some links?
Anticipated thanks...
MouseEvent.CLICK & Loader.content
Ok, I've read up on this and I know adding MouseEvent.CLICK to Loader.content does nothing. I'm looking for an explanation, in code, as to how this is supposed to work then. I've tried
Code:
container.addChild( Loader.content );
container.addEventListener( MouseEvent.CLICK, handleClick );
I've tried
Code:
var swf:MovieClip = Loader.content as MovieClip;
container.addChild( swf );
container.addEventListener( MouseEvent.CLICK, handleClick )
;
I've tried a few other ways too, but nothing seems to be working, and I can't find this solution out there, so Please, Help!
thanks
Scaling Content In Loader Component
Hi!
I am using a loader component to dynamically load contents. Say the loaded content coming from outside is a kind of rectangle in shape and when I keep the loader shape as square (meaning that I want the contents to get displayed in the form of square shape) the contents are not exactly the shape of the loader. Can someone help me with this? Does loader component scale content only proportionally? If there is any code to load it exactly the way I want it to, can you guys let me know what to do?
Regards,
Kirthi
Scaling Content Using Loader Component
Hi!
I am using a loader component to dynamically load contents. Say the loaded content coming from outside is a kind of rectangle in shape and when I keep the loader shape as square (meaning that I want the contents to get displayed in the form of square shape) the contents are not exactly the shape of the loader. Can someone help me with this? Does loader component scale content only proportionally? If there is any code to load it exactly the way I want it to, can you guys let me know what to do?
Regards,
Kirthi
Content Path Of Image Loader
I created a loader for thumbnails in my flash document, I was wondering...is there a way to code the loader so that it can pull up the images from folders, because the only way it works is if the images are in the same folder as the .swf where the loader is??
or if anyone has a better solution, please inform me. Thank you.
Preloader For Loader Component Content
hi there
i`m new to this. And i have a problem i`m trying to solve. I have a site made in flash and i use loader component to load different swf`s. But the swf`s are pretty large and i want to have a simple preloader to show the message "loading" and no percentage for each swf i load. I found many tutorials about that, but all are mentioning the preloader component, and i do not want to use that because i want my own made frames in the preload animation (like the logo of my site for example). Can anyone help me on that, or point me some links?
Anticipated thanks...
Custom Preloader For Loader Component Content
hi there
i`m new to this. And i have a problem i`m trying to solve. I have a site made in flash and i use loader component to load different swf`s. But the swf`s are pretty large and i want to have a simple preloader to show the message "loading" and no percentage for each swf i load. I found many tutorials about that, but all are mentioning the preloader component, and i do not want to use that because i want my own made frames in the preload animation (like the logo of my site for example). Can anyone help me on that, or point me some links?
Anticipated thanks...
Loading A New Movie In The Current Content Loader
Hello..I've done a search to the best of my ability but can't seem to find exactly how solve this problem. I'm quite the beginner and just purchased the book How to Wow with Flash and have followed the steps to create "shell-based navigation" for my website.
Here is the link to the website: http://erc.southern.edu
I have a template page with several permanent links that load the various sub-pages using a content loader movie(which I named cloader_mc). For example, for the DVDs link, here is the script I am using:
dvds.onRelease = function(){
cloader_mc.loadMovie("dvds/dvds.swf");
}
This works beautifully, but I don't know how to make new links in the dvds.swf movie load in the same "frame". When I make a link, it displays the movie in completely replaces the entire site. Basically, I need links in my subpages to point to the very same content loader that they themselves are nested in.
From searching, I know I have to point to the parent first or something like that but I have no idea how to do this. Any help would be awesome!
P.S.--to be more specific, I have another swf in the dvds folder named ERCTestimonial.swf that I want to link to from the the initial dvds subpage.
Loading A New Movie In The Current Content Loader
Hello..I've done a search to the best of my ability but can't seem to find exactly how solve this problem. I'm quite the beginner and just purchased the book How to Wow with Flash and have followed the steps to create "shell-based navigation" for my website.
Here is the link to the website: http://erc.southern.edu
I have a template page with several permanent links that load the various sub-pages using a content loader movie(which I named cloader_mc). For example, for the DVDs link, here is the script I am using:
dvds.onRelease = function(){
cloader_mc.loadMovie("dvds/dvds.swf");
}
This works beautifully, but I don't know how to make new links in the dvds.swf movie load in the same "frame". When I make a link, it displays the movie in completely replaces the entire site. Basically, I need links in my subpages to point to the very same content loader that they themselves are nested in.
From searching, I know I have to point to the parent first or something like that but I have no idea how to do this. Any help would be awesome!
P.S.--to be more specific, I have another swf in the dvds folder named ERCTestimonial.swf that I want to link to from the the initial dvds subpage.
Load Random Content Into Loader Component?
As the subject suggests, I'm trying to load random content (regular old jpg's in this case) into a loader component.
I have an old script I found around the web before, where I basically make a new keyframe on the main timeline with a loader component in each one and the file in the content path of the parameters part like normal and the script tells it to gotoAndStop on a random frame.
But, this time, I have about 50 pics to randomize. I'm wondering if there's an easier way (more like a less tedious way) to do this where I don't have to make 50 keyframes and click all over to change the filename on each one.
Is there any way to just have 1 loader component, and then an action script that says "here's a list of images, display a random one when we load the page and stop there"? I'm thinking there must be some way to do it with XML too to specify all the images, but I never worked with XML & flash together before
So how can I do this? Anyone have any ideas? I'm not big on writing script stufff, so this one has be a little stumped even though I'm sure it's easier than I think. Any help would be greatly appreciated ;)
Load Random Content Into Loader Component?
As the subject suggests, I'm trying to load random content (regular old jpg's in this case) into a loader component.
I have an old script I found around the web before, where I basically make a new keyframe on the main timeline with a loader component in each one and the file in the content path of the parameters part like normal and the script tells it to gotoAndStop on a random frame.
But, this time, I have about 50 pics to randomize. I'm wondering if there's an easier way (more like a less tedious way) to do this where I don't have to make 50 keyframes and click all over to change the filename on each one.
Is there any way to just have 1 loader component, and then an action script that says "here's a list of images, display a random one when we load the page and stop there"? I'm thinking there must be some way to do it with XML too to specify all the images, but I never worked with XML & flash together before
So how can I do this? Anyone have any ideas? I'm not big on writing script stufff, so this one has be a little stumped even though I'm sure it's easier than I think. Any help would be greatly appreciated ;)
Loader Doesnt Load Content In Firefox
I have created an application using flash and the loader component to showcase some cars however i have noticed that the loader component loads the images in Internet explorer but not flash does anyone have an idea as to why this is so? It worked perfectly while it was on my local machine but it doesn't work at all on the server. All suggestions and comments will be warmly welcome. Also how do you find the size of a jpg picture in a loader?
Loading A New Movie In The Current Content Loader
Hello..I've done a search to the best of my ability but can't seem to find exactly how solve this problem. I'm quite the beginner and just purchased the book How to Wow with Flash and have followed the steps to create "shell-based navigation" for my website.
Here is the link to the website: http://erc.southern.edu
I have a template page with several permanent links that load the various sub-pages using a content loader movie(which I named cloader_mc). For example, for the DVDs link, here is the script I am using:
dvds.onRelease = function(){
cloader_mc.loadMovie("dvds/dvds.swf");
}
This works beautifully, but I don't know how to make new links in the dvds.swf movie load in the same "frame". When I make a link, it displays the movie in completely replaces the entire site. Basically, I need links in my subpages to point to the very same content loader that they themselves are nested in.
From searching, I know I have to point to the parent first or something like that but I have no idea how to do this. Any help would be awesome!
P.S.--to be more specific, I have another swf in the dvds folder named ERCTestimonial.swf that I want to link to from the the initial dvds subpage.
Duplicate The Content Loaded Into A Loader Instance?
This is probably so simple, but I'm trying to figure out how to use the visual assets from a Loader instance multiple times.
I'm creating a square with a cutout shape (which comes from the Loader instance); but because the square (button) is made up of multiple mcs with various Layer/Erase blendmode voodoo, I need three instances of the cutout.
While I'm sure I could make it work fine if I created, say, three separate Loader instances, I'd rather not -- I mean, surely there's a way to re-use the one Loader instance?
I couldn't find the equivalent of a clone() method, and quite frankly, I'm at a loss. I'd appreciate any help anyone can provide!
Problem With Loader Object, Some Users Donīt See The Content
Iīm having a weird problem where a Flash is loading another swf object through the a Loader object. For a certain group of users (in a different location), this swf does not load, and no error message or anything is returned.
For me and others in my office, this works without a hitch. Iīve tried adding various event listeners to the Loader, but it appears that for these people no events are fired. The other content in the main swf works just fine. This does not appear to be caused by firewall/adblockers/popup blockers, etc.
Iīm fairly new to Flash development, and I really have no idea where to start debugging this. Anyone ever experienced something like this? The swf that is supposed to be loaded is a loader itself, which again loads another, final swf. Everything is served through a webpage, so itīs really weird to see this inconsistent behaviour.
If anyone can give me some tips on where to start, it would be greatly appreciated.
Flash Loader Content Paths. Arrgghh Help
Hi all,
I'm using a flash 8 loader component in a main swf which loads (via a button) another swf with three buttons to three movies. Now, the main swf loads the second loader comp fine but then this second loader cannot load or see the movies!! If I test the movie within flash everything works but when it's placed in the web page then the second loader cannot see the movies I need to load!!! I'm pulling my hair out here, does anyone have any pointers?
Rob
|