A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 44

Thread: Need help: load movie clip from library without exporting on frame 1?

  1. #21
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Yes, it does concern a preloader. Just because I ask how to make sauce for a hamburger does not mean I want you to build me an oven to bake bread for hamburgers.

    Just one little problem: I want to use the character movie clip in the preloader.
    Why do we even have to argue? No need to leave a comment if you feel you're losing your time. Just don't blame me for not begin grateful you built me an oven when all I needed was a sauce recipe.

  2. #22
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    You are sooo ungrateful haha and arrogant haha.
    Just one little problem: I want to use the character movie clip in the preloader.
    And that was precisely what i gave you. The Character Movieclip was attached "AFTER" the preloader at %60-%100. I'm not the one arguing here , i'm just leaving clear that you forgot a lot of information and that i "tried" with that "little" information you gave, to help you and you have been very ungrateful and demanding and arrogant. You didn't even posted any .fla, any script, and you dared to criticize my script. I did exactly what the title of your thread says "load a movieclip without exporting it to frame 1". I guided you how to attach a movieclip dynamically, exporting it for actionscript, and unchecking the "export to frame 1" option. Then I guided you how to attach the movieclip at 60%. Then i guided you to export the classes to frame 2 instead of frame 1. My job here is done. If you are not satisfied, go to Mc donalds with the receipt and tell them the "sauce" was thaaat bad and that you didn't ask for a hamburger.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #23
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hi,

    sorry for intervening, but koenahn is right, this is all just a huge misunderstanding in communication.

    You are sooo ungrateful haha and arrogant haha ... you have been very ungrateful and demanding and arrogant
    Actually, koenahn thanked you for your effort and eagerness in helping him, several times, and also apologized for you two misunderstanding each other:

    Thanks for your time, angelhdz!
    I really appreciate your eagerness to help me.
    Again, I sincerely appreciate your help.

    I'm sorry we misunderstood each other.
    I hope this miscommunication hasn't frustrated you too much, that wasn't my intention.
    I am not saying that you are wrong, angelhdz, I just don't understand why you started to get angry with him when he always replied kindly? Maybe you did misunderstand? I am not trying to take anyone's side, but I'm trying to help here. I've seen koenahn help other people here many times before, so I see no reason for him to quarrel with you, right?

    He does actually state his problem in the original post:

    Now many of you might say things like 'just set the character clip to 'export on frame 1', but the problem is that if I do, the character clip will load before the preloader shows, rendering the preloader kind of useless.
    In the bold text, there's already some hint of his problem - he wants to load the character AFTER the preloader, but that's insufficient, we need more info, and this step-by-step text shows what he really wants:

    1. User somehow opens the .swf.
    2. .swf loads the preloader (white screen) (does not take long)
    3. .swf shows the preloader (preloader is now visible)
    4. .swf loads the character movie clip (preloader still visible)
    5. .swf attaches the character movie clip to the stage (preloader and character clips are now visible)
    6. .swf loads the rest of the game's contents (while preloader and character are still both visible)
    7. if getBytesLoaded() == getBytesTotal() I'll take it form here.
    1. Someone opens the SWF file, in some browser, for example.
    2. SWF starts loading the first frame, where the preloader is, because the preloader itself also contains graphics and coding, so Flash actually needs to load that first, before it can show itself, and that's what he means by the white screen. The white screen is shown before the preloader's design and coding has been loaded (actually, before the whole first frame has been loaded), then after that, it is shown, so he doesn't want a custom white screen, but it's an inevitable white screen, you can't do much to prevent it.
    3. Flash has now fully loaded the preloader's design and coding (and the whole first frame), so it's now displayed, the user can see it.
    4. Flash loads the character movieclip
    5. This is pretty self-explanatory
    6. "Flash loads the rest of the game's contents", here is where the main problem is shown. He says "the rest of teh game's contents", which means that he would like the preloader to load the character movieclip first, then have it load the rest of the game's content.

    I must admit, it also took me some time to get what he really meant, but after reading his second post:

    What would help is if somebody could tell me if it is possible to tell Flash to load certain clips before others...
    The real reason you're misunderstanding each other, is that the preloader you program in Flash, isn't really a preloader at all. All it does, is that is shows how much of the SWF file Flash actually has loaded, so the actual preloading is handled by Flash itself, it's not something we have control over. So, my answer is; NO, you cannot decide which movieclip to load before others, because Flash does that for you, and there's no built-in function to accomplish such, hence it's not possible!

    Did you export the Class to frame 2? File >Actionscript 2.0 settings > Export Frame for classes > type 2
    That won't help, because that only includes Classes, and Library Items are NOT classes, at least not in Actionscript 2 (they are in AS3). Therefore, it's not possible to decide in the Linkage options, which Frame to export a Library Attach item, but you can do that manually, by unchecking "Export in first frame", and then manually placing your movieclip on the Frame you want it to be loaded, then it's available throughout the rest of the movie through Actionscript, because usually, when that option is ticked/checked, all those items are loaded in the First Frame.

    However, there's an option which you can consider using instead. It's not exactly what you want, but better than nothing, right :P?

    There's an event handler which is called when a Movieclip is loaded, it's the onLoad handler. If you use it on the _root movieclip, you can check when the Flash file has fully loaded. I did an experiment myself, and it indeed works with the white screen, and is called once the first frame is visible (i.e. right after the white screen is gone). You can exploit this event handler to check when your Flash movie has been loaded, and then instantly redirect it to Frame 2, where supposedly the movieclip is. Then, you can use the movieclips' properties, getBytesLoaded() and getBytesTotal(), to check when your movieclip is fully loaded. I am not sure if this will work, because I haven't tried the method with having the movieclip on second frame, hence I don't know whether it will actually be shown at once there, or if it will appear once it has been loaded (once getBytesLoaded()/getBytesTotal() is equals to 1 [, or 100, if you're multiplying it with 100]). You'll just have to try that for yourself and see if it works. The reason this isn't what you want, is because you don't know when Flash will actually load that movieclip. Maybe it will load it in the end, or halfway through - you never know, but if this works, it's the closest you will get, I think. If you're trying this inside Flash using download stimulation, onLoad will be called instantly when the Test Movie flash player shows up, so don't get fooled by that, because when testing in your browser - according to my experiment - onLoad will be called when the white screen is gone, and the flash's first frame has been loaded and fully displayed.

    I hope this helps, and I also hope that you two look past the misunderstanding and get back on good terms
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  4. #24
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Nig, thank you so much for your intervention. I cannot stress enough how haunted I have been by this useless dispute. I trust Angelhdz will also appreciate your 'impartial judgment', for lack of better terminology.

    I am also very satisfied with the answers you have supplied me with. I will try the proposed method as soon as I get the opportunity to do so.

    Angelhdz: I hope you now see my side if the story and will no longer be mad at me, because neither of us deserves otherwise.

    Peace.

  5. #25
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Nig thanks. But I really and finally understood what He wanted to achieve, and I was about to redirect him into the loadClip, onLoadInit stuff and that was when i suggested him to export the whole game into a separate .swf, and then load everything step by step, in the order he wanted. The issue started when he critizised my script. Yeah, i got angry. He said my script was flawed. Before that, I was calmed calmed down, trying to understand him, he didn't even posted any FLA, or SCRIPT, and that's something you also hate Nig, people who don't make an effort and want someone to give EVERYTHING DONE FOR THEM. In the first posts he made, everything pointed to the fact of Preloading Order, and I pointed him into that direction: 1-white screen 2-preloader attached 3-at 60% character movieclip attached 4- and everything keep loading until 100%. After that, he explained better what he wanted to achieved and i said to myself "huh, i don't think that's possible because flash itself decides what it want to load in the order it wants" and here was when i suggested him to use the loadClip and onLoadInit stuff, to load an external movieclips, also we can have the character movieclip in a separate .swf and load it with in an empty movieclip, referring to the empty movieclip instance name and then the character MC instance name.

    Nig
    That won't help, because that only includes Classes, and Library Items are NOT classes, at least not in Actionscript 2 (they are in AS3). Therefore, it's not possible to decide in the Linkage options, which Frame to export a Library Attach item, but you can do that manually, by unchecking "Export in first frame", and then manually placing your movieclip on the Frame you want it to be loaded, then it's available throughout the rest of the movie through Actionscript, because usually, when that option is ticked/checked, all those items are loaded in the First Frame.
    That was PRECISELY what i did. I pointed him to uncheck the export to first frame option, and ATTACH THE MOVIECLIP DYNAMICALLY , in the frame he wanted, and in the preloading percent % he wanted.

    But that wasn't enough for him, so I gave up, but however, his
    attitude was arrogant. I was the only one who spent time on him trying to help, everything to finally realize that what he wanted to achieve was not possible.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  6. #26
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Angelhdz, you are right that I should not have described your code as 'flawed'. Your code was good, it just did not apply to my situation. I would like to take 'flawed' back, please.

  7. #27
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ok we're cool. Hope the "onLoad, loadClip, onLoadInit" thing that Nig13 and I suggested, works for you. Good luck
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  8. #28
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Thank you!
    I'll let you know if it worked as soon as I get round to trying it.

  9. #29
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hi,

    glad to know that I at least helped a bit

    angelhdz, he didn't mean it like that. What he was trying to say, is that you cannot know at what percentage the movieclip is loaded, therefore you cannot check if the loading is equals to a definite number, in this case 60%, but that was the effect of the misunderstanding. I can understand your frustration and anger, but that was all due to you not entirely understanding his problem, and I understand that as well, because I've read lots of posts which cause confusion and frustration, but then, I either just leave the post, or ask them what they actually want and that they need to explain it better. I do really appreciate that you're still here, helping people and that you took the initiative of helping koenahn, but you might consider not jumping to conclusions, and try to compromise a little as well

    The reason for him not posting any assets, is already explained in his second post:

    I would upload the flash file, but I highly doubt that would help. My question does not concern a bug or particular case, but a principle of Flash. So although I really appreciate your willingness to help me, I don't think uploading the .fla would make things much easier.
    no matter how much I hate people not posting assets for us to look at and get a better idea, this problem doesn't require such, because it's like he's saying, it wouldn't really help if he posted his preloader and movieclip, right?

    That was PRECISELY what i did. I pointed him to uncheck the export to first frame option, and ATTACH THE MOVIECLIP DYNAMICALLY , in the frame he wanted, and in the preloading percent % he wanted.
    but that isn't what he want D:
    he doesn't want to manually attach the movieclip on a specific percentage. He wants to know if it's possible to check WHEN Flash actually loads the movieclip, when it is already there, or more specifically, he wants to know if it's possible to first load the movieclip, then the rest of the whole flash. It isn't about a specific percent, it's about something far more difficult, almost impossible (that basically means, it's impossible, unless you use a hack or something XD)

    But that wasn't enough for him, so I gave up, but however, his
    attitude was arrogant
    .
    I think that depends entirely on how we read a text. Maybe you read it in an angry voice? According to my perception, he seems to really appreciate your attempt at helping him, but he's also stating that what you're trying to help with, isn't what he's actually asking for, be he does appreciate all the effort you've put into writing all that which you've written, and I appreciate that as well, but you could have avoided that by just asking him to explain what he wanted, a bit better and with more details

    I was the only one who spent time on him trying to help, everything to finally realize that what he wanted to achieve was not possible.
    Yes, and I really appreciate that you're still active here. Thanks a lot

    I also forgot to mention that your external SWF idea is just brilliant, it could actually work!

    koenahn, is it an option to have your movieclip content inside another SWF, to load it inside the main swf, which you'll be able to keep track of? Or do you need interaction between the content of the movieclip and the main swf? If so, then that might be a problem.
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  10. #30
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hope the "onLoad, loadClip, onLoadInit" thing that Nig13 and I suggested, works for you.
    I didn't suggest that, I was referring to something else XD

    All props to you for coming up with that ingenious idea
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  11. #31
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Nig, where he mentioned the fact of "calculation the movieclip's size/weight" in order to load it? If he did, i'm blind then hehe. He in EVERY OPPORTUNITY mentioned the fact of "loading the character movieclip after the preloader movieclip and not before". That was all. And that's why I suggested loading the character movieclip dynamically at 60%, because at that percent, the preloader movieclip have been loaded. I never reed anything about "calculating the movieclip's size/weight" because that's something weird. People only use to preloader to preload "EVERYTHING" at once.

    Very after that, few posts later, he said that the character movieclip was "HUGE" and right there i said "mmmm so is better to have the preloader in one .swf and the complete game in another .swf and load them externally" and he never said "good idea Angel" and i get really frustrated.

    If I keep commenting and posting, is because i don't like to let things uncompleted. I like to reach the end in order to fix a problem or end a query because I learn at the same time. The first time I came by this post, i thought about the "onLoad, LoadClip, onLoadInit" idea, but I tried to achieve it without using it, just using the old preloading system with getBytes inside the onEnterFrame, on the first frame etc etc etc and when reaching %100, go to frame 2. But when I keep going further with him, i said "definitely, he will need to use the onLoad function" and in fact, I told him to do that, but He implied that I was a noob or something, that i didn't know what i was doing, and he made me feel bad with the "flawed" thing. ALL OF THIS WOULD HAVE BEEN SOLVED QUICKCLY, if he would have take into consideration my onLoad/external .swf idea. But he never said anything about that, then he again made me feel bad with the "sauce/hamburger" stuff. That wasn't necessary. That's why it felt like if I was "arguing". I don't like to argue, i hate it, but when someone that i'm helping makes me feel bad, i won't stay quiet. Good bye guys
    Last edited by angelhdz; 10-07-2012 at 08:07 PM.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  12. #32
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    @koenahn : I dont understand how do you know the size of your pre-loader, character and the rest of your game in percentages, but if your game shows the pre-loader only once then it loads the game first time, then Id suggest you to separate your pre-loader along with a minimum animated character along with the pre-loader in a separate swf file. The steps will be like:

    1. Flash Loads the preloader.swf
    2. Pre-loader shows itself along with the Character
    3. Preloader Class will load the game.swf
    4. After all Loads are done, unload the preloader.swf

    So the main Character of your game will load from the game.swf file and the preloader is not loading the actual Character.

    If you are using png file for that Character and also used that png in your game, Flash will use the first loaded png if that is in same name and file and will not unload that png after unloading the pre-loader.

    There is no point to keep your pre-loader in memory throughout the lifetime of the game if it is used for only once.

    Possibilities of loading the swf slow, as you are adding the light edition of the Character into the pre-loader, but it will make faster to load the rest or your game and run it smoothly. You can also program it so the user loads the game next time, will not have to wait for the pre-loader to load and can enter straight to the game.swf.

    If your game needs the pre-loader time to time in between your game, I should suggest you to keep another pre-loader in your game.swf without that character so that you can use it throughout the game where it needs.



    arkitx

  13. #33
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Okay, I have five comments to make here.


    First off, I want to get this clear: the percentages I mentioned were an example. I did not say those were 'the numbers', so to speak.

    Quote Originally Posted by koenahn View Post
    (e.g. 10 to 60 percent)
    [...]
    (e.g. 60 to 100 percent)
    [...]
    In this example, the size of the preloader is 10%, the size of the character is 50% and the size of the 'rest' is 40%.
    As you see, I clearly used 'e.g.', which means 'for instance', and I said 'in this example', not 'in my case'. Clearly my formulation was confusing. That's why I later added:

    Quote Originally Posted by koenahn View Post
    All I want is for the character clip to show as soon as that is possible, without having to wait for the character clip to load before displaying the preloader. Arbitrary numbers such as '40%' will not fix my problem.
    After that it still wasn't clear, so I was happy when Nig showed up to explain what I meant:

    Quote Originally Posted by Nig 13 View Post
    He doesn't want to manually attach the movieclip on a specific percentage. He wants to know if it's possible to check WHEN Flash actually loads the movieclip, when it is already there, or more specifically, he wants to know if it's possible to first load the movieclip, then the rest of the whole flash. It isn't about a specific percent, it's about something far more difficult, almost impossible (that basically means, it's impossible, unless you use a hack or something XD)
    But apparently that also flew by. Please, gentlemen, no more percentages in our code.


    Second: I don't think I can use an external swf for the character. It has to hitTest() with all the levels. Using an external first level for a preloader as Arkitx suggests sounds tempting but would only make the wait longer, which is not what I'm going for (as a design principle: the preloader serves a the purpose of making things easier while the player is waiting, not to make the wait longer). Just fyi: the character is so heavy because he contains a dozen or so different animations for movements (such as running, jumping, braking, falling—you get the gist), and this number is still ascending as I'm still building the game.


    Third: I am going to try things the onLoad() way as soon as I have the time to resume, and I will keep you all informed about my progress.


    Fourth: thank you all for being so patient with me, while I clearly haven't been explicit enough about the solution I'm looking for.


    Fifth and last: if I ever seem to use words that are out of place and make me sound arrogant (Angelhdz?) I want you to know that English is not my first language and that I'm genuinely sorry if I come across as unkind. I do my best to formulate clearly and politely.

  14. #34
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Beats me as well why people are clinging to those percentages when it was mentioned several times about their randomness xD

    and I think your English is really great, and it's hard for me to believe that it isn't your mother tongue.
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  15. #35
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    I think humans like the comfort that facts and numbers provide XD

    Nig, I'm flattered, thank you. Actually I'm from Holland, and English is my third language. But I must say that if I've picked up on it, it has mostly been thanks to the internet. However, your compliment does omit my excuse for any possible rude use of English, on which I was hoping I could blame the earlier misunderstanding regarding my use of the word 'flawed'.

    Just kidding! I just hope the miscommunication wasn't (partly) caused by linguistic incompatibility, that would be too bad.

  16. #36
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    I meant 'we humans', not 'humans' of course. It's not like I'm an alien AI sent to infiltrate the internet whilst collecting data in order to have the upper hand when my leaders declare war on your planet or anything.

  17. #37
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    Sorry! I am trying to go through your pre-loader with character problem and not through where you tried to say that is an example. And I apologies for not reading the whole thread.

    Oh Yes I am very bad in English, not you are.

    What I think is the fastest way to load if you take a test of it instead of waiting of someones reply.

    Again I am sorry if you feel I am rude.


    BTW: How you structured your application? And what CODE you are using for your pre-loader?



    arkitx
    Last edited by arkitx; 10-08-2012 at 06:21 PM.

  18. #38
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    No problem, koenahn, we are cool. And did you know, my first language is SPANISH, i have to translate some words in Google Translator in order to comunicate with all of you hehe so, don't worry about that. Thanks Nig and arkitx for coming by to help. And i really want you to suceed with this koenahn. Good luck, and don't forget about the onLoad, LoadClip and onLoadInit stuff, trust me, i learned about it recently thanks to Nig and others, and it's really nice the things it let you to make, you can have a movieclip being loaded and no visible until the load completes, then turn it visible, calculate the size, and other stuff like do things before loading, while loading and after loading.

    Sorry if I sounded like if I were "arguing". And if you need my help sometime don't hesitate on contacting me. Greetings my friend Nig, let's make a revolution, so we can have the OLD FORUM DESIGN BACK! Hehe!
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  19. #39
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    Arkitx: you are not being rude at all, I was referring to a misunderstanding between Angelhdz and me. He and I are cool now though and I'm very happy about that.

    As for what you said about testing something being the fastest solution, I don't really understand what you mean. Also, the code used in my preloader is of no importance - I suggest you just wait until I have some news on how things went with onLoad.

  20. #40
    Senior Member
    Join Date
    Aug 2006
    Posts
    322
    This thread is a great example and also a teaching lesson for the forum administrators.

    Its always an Original Poster of a thread creates a New Thread willing to get solutions of his/her current problems regarding a particular issue. Similarly the kind members of this forum are also tried to help by posting his/her opinion. There might be a problem of miscommunication to express the actual problem or the giving solutions because of the lack of English terminology or for the language is not being the mother tongue for both the person. The person who helped will also wait for the reply of the OP because they also learn if the solution works for that particular problem. So, there is a learning process running between both of them. If any thread ends with no success, sometimes someone put a great solution which might be after many times later. This is only because to help someone who might come across with the same problem.

    This is clear that forums are 100% for helping yourself as well as others who are also in same track. My intention to post in this thread is to remind you that we also have a universal language which is known to all of the developers, which is the language of the programming itself and also the file or a clone file of the original problem file. This is my request to all the members of this forum to please keep this in mind as because only for these causes this forum looses members who always came to visit to help, to learn.

    Administrators must look at these types of problems and issues, not only because of the business but also to increase the real assets of technologies which the members are posting every hrs.

    I found the actual problem of this thread is not to post the problem file or not to show a bit of code which the OP is continuously thinking it negligible or might thinking that it will not worth to show some sensitive code he/she using.

    The forum has an unwritten law is to give and take of knowledge between both of you which you both have to maintain to increase both of your knowledge including others. I think there is always a solution behind a problem, so every thread must ends up with some kind of good solutions instead of a message of RESOLVED.

    @OP: you might get a good solution if you followed these at the beginning. It might not a place of arguments, except the programming or the code which we are all talking about. Otherwise one day we all loose to get a single reply form other great programmers.

    @P: Dont expect a resolved result of any threads you helped. Otherwise you will get frustrated giving your time to this forum. We all know that there is a relative chance of misunderstanding between members and the simple solution is to create a new thread mentioning the solution of certain problems. This might be an article one day. By doing this, will also help others who are seriously going out of such particular problem.

    I will be happy if you all get good solution of this problem.



    Best of LUCK..



    marlopax

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center