| Ultrashock Forums
• Preloader Problems |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2008-10-28
#2 |
||
|
I just copied and pasted your code and created a file called "JA.swf" with a 1 meg .jpg in it and it worked perfectly. Dumb question, what does your "JA.swf" contain???
|
|
|
2008-10-29
#3 |
||
|
You can try to see if the below works. It's almost the same code except I created a variable for your loader.content. Code:
var PageLoader:Loader = new Loader();
PageLoader.contentLoaderInfo.addEventListener( ProgressEvent.PROGRESS, Progress );
PageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, Complete );
PageLoader.load(new URLRequest('JA.swf'));
function Progress(event:ProgressEvent)
{
/// DO SOMETHING
}
function Complete(event:Event)
{
PageLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, Progress);
PageLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, Complete);
PageLoader = null;
var content:MovieClip = PageLoader.content as MovieClip;
addChild( content );
}
|
|
|
2008-10-30
#4 |
||
|
I know! The weird thing is that I used the same Preloader for another Page and it worked just fine! I think that the main problem is, that I load external File's right in the first frame of the JA.swf. Because as long as i dont load external stuff the Preloader works just. Maybe, the COMLETE Event of the XML I load in the first frame, also Triggers the COMPLETE Event of the Preloader. To see the Bug, let the Preloader load one of your Pages that load external Content ... |
|
|
2008-10-30
#5 |
||
|
I just copied and pasted your code and created a file called "JA.swf" with a 1 meg .jpg in it and it worked perfectly. Dumb question, what does your "JA.swf" contain???
It's a medium size Flash Page! Nothing special though. Loads an XML right at the beginning! After that i add a view classes to manage the content ... I can send you the code if you want to take a close look at it .... |
|
|
2008-10-30
#6 |
||
|
Sure, post your code and I will try to help.
|
|
|
2008-10-30
#7 |
||
|
Well that is quit a lot to post: Scene 1/ Frame 1: Code:
var MasterXML:XMLList;
function Init () {
var Link:String = 'http://juerke-architekten.kms-team.de/backend/flash-xml.php';
var XMLRequest:URLRequest = new URLRequest(Link);
var XMLLoader:URLLoader = new URLLoader();
XMLLoader.addEventListener(Event.COMPLETE, ManageXML);
XMLLoader.load(XMLRequest);
}
function ManageXML (event:Event) {
MasterXML = XMLList(event.target.data);;
nextScene();
}
Init();
stop();
Code:
/// STAGE SETTINGS //// stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; ///////////////////////// import External.NavigationControl; import External.ImageEngine; import External.ScaleEngine; import External.ManageContent; var ImageClass:ImageEngine = new ImageEngine(ImageHolder.Holder); var ScaleClass:ScaleEngine = new ScaleEngine(stage, this); ScaleClass.Image = ImageHolder.Holder; var NavigationClass:NavigationControl = new NavigationControl(); NavigationClass.Reference = Navigation; NavigationClass.MenuStatus = 'Covered'; NavigationClass.MainTimeline = this; NavigationClass.Init(); var ContentClass:ManageContent = new ManageContent(); ContentClass.ImageHandler = ImageClass; ContentClass.ImageHolder = ImageHolder; ContentClass.MainTimeline = this; ContentClass.MasterXML = MasterXML; ContentClass.FunctionClass.MasterXML = MasterXML; ContentClass.ScaleClass = ScaleClass; ContentClass.NavigationClass = NavigationClass; this.addChild(ContentClass); setTimeout(NavigationClass.Click, 5, 'Default1'); stop(); But the Classes are probably too long to post here - but if you want to i can email you the whole thing ... but that might not be necessary ... Thanks by the way ....
|
|
27 Creative Assets
|
2008-11-03
#8 |
||
|
hey FourTimesDaily i had to delete the other thread you created since you cant create duplicated threads for the same subject, besides you have recived help here, you just have to be pacient, instead of creating another thread for the same subject you can bump this thread, asking for people's help again.
|
|
|
2008-11-03
#9 |
||
|
hey FourTimesDaily i had to delete the other thread you created since you cant create duplicated threads for the same subject, besides you have recived help here, you just have to be pacient, instead of creating another thread for the same subject you can bump this thread, asking for people's help again.
![]() You said something about bumping the thread!! How do i do this to get people to get notice of my thread .... Thanks ... |
|
17 Creative Assets
|
2008-11-03
#10 |
||
|
One big problem is you are setting the Loader ( PageLoader ) to null before you pull the content from it. Flash should be spitting out an error because of that, if it isn't then TURN ERROR REPORTING BACK ON otherwise you will get stuck like this every time you try doing something with a null object. If the Loader is only being used to load a single SWF file then you can just add it directly to the display list. Code:
function complete (event:Event):void {
pageLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
pageLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, complete);
//pageLoader = null;
addChild(pageLoader);
}
|
|
|
2008-11-03
#11 |
||
|
Still don't work! It still triggers the complete function over and over ... plus it never loads the the SWF ... PS: Is there a certain reason why i should use lowercase characters or is it just more common ? |
|
|
2008-11-03
#12 |
||
|
+ I have the Error Reporting on and it doesn't report anything! What i said in myprevious post is not completley right! It does load the SWF because i can trace the bytes being loaded, it just never adds it to the stage ... ! I hope that info helps |
|
17 Creative Assets
|
2008-11-03
#13 |
||
|
Are you sure it doesn't add it to the stage? Give this a try... Code:
function complete (event:Event):void {
pageLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
pageLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, complete);
//pageLoader = null;
addChild(pageLoader);
trace( contains( pageLoader ) ? "content has been added" : "content has not been added" );
}
Using lowercase characters at the start of variable and function names is a common coding convention (i.e. it is standard and is expected but not required). AS3 Coding Conventions |
|
|
2008-11-03
#14 |
||
|
Ok - I checked it and it does add it to the stage! I just never shows the contant! Then i thought the prolem has to be the XML thats loaded right at the beginning of the JA.swf! I thought that it starts loading the XML before it's actually loaded to the stage! But when i stop the XML from being loaded i actually see that content but the whole actionscript (as posted above) is not read ... (you get what i mean?)
|
|
|
2008-11-12
#15 |
||
|
So noone got an idea???
|
|
|
2008-11-12
#16 |
||
|
Last edited by Artofacks1 : 2008-11-12 at 16:16.
Try this class ActionScript Code:
you use it like this. ActionScript Code:
|
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


15 comments
| 460 views




27 Creative Assets
Linear Mode