Copy link to clipboard
Copied
I work on develop Android App for learning Arabic, it is very simple.
to explain the alphabet, I create and I load external swfs files, first and the second loaders are working good (loading and when click any buttons there are no any issue)
but the third loader is loading good also, but the problem when I test the project, I get run time error when press home button.
(it does not happen when loading the other loaders)
here is the sours files Android Project.rar - Google Drive
Thanks
the problem is in the way you're using to add the event listeners to the buttons, you're adding a different click event listener for them every key frame, so you have to remove the listeners before you leave to another frame.
Copy link to clipboard
Copied
Can you copy and paste the error here? or the code that you think it's causing the error.. maybe someone can help you, thanks.
Copy link to clipboard
Copied
to make it easier I enclosed a link to the source files of my project ( it contains 10 frames only)
No compiler error, it is run-time error
by the way there are no error when I remove the loader from the frame
Error #1009: Cannot access a property or method of a null object reference.
at LearnArabic_fla::MainTimeline/frame1()[LearnArabic_fla.MainTimeline::frame1:74]
at flash.display::MovieClip/gotoAndStop()
at LearnArabic_fla::MainTimeline/home_ClickToGoToAndStopAtFrame_3()[LearnArabic_fla.MainTimeline::frame1:120]
link to the files
Android Project.rar - Google Drive
Thanks for your advice
Copy link to clipboard
Copied
your file contains TLF text fields and it's no more supported in flash cc so I can't test the file.. as it's contains a lot of frames and script lines that will not be easy to understand.. anyway as I see in your reply the error in the line 120
home_btn.addEventListener(MouseEvent.CLICK, home_ClickToGoToAndStopAtFrame_3);
function home_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
{
gotoAndStop("home");// line 120
}
This function in frame 1 and the frame name is "home", so the timeline already on frame "home", so you don't need this function remove it and try.
Copy link to clipboard
Copied
there is no error when I remove the last loader from the frame
and I need the home button to go back from other frames. it works well without the third loader
Copy link to clipboard
Copied
I've tested the App and I've seen a strange thing as I couldn't know the reason maybe you have to check it and find the reason to solve it.
the wrong is that when the timeline being on last key frame and I press home btn, the button (levelOne) in "home" key frame disappears by itself! and one more button also in the same key frame.. that's why you're getting the error, so you have to check why those buttons disappears?!
Copy link to clipboard
Copied
the problem is in the way you're using to add the event listeners to the buttons, you're adding a different click event listener for them every key frame, so you have to remove the listeners before you leave to another frame.
Copy link to clipboard
Copied
I added the event listeners in the first frame to make links to (home,info and help) on the layer ( my menu) and I added frame until the last frame.
as I mentioned above, there are no any errors regarding the first and the second loader, only the run-time error when I add the third loader.
however, thanks I solved the error by make movie clip instead of loading swif file, it works same the loader
Copy link to clipboard
Copied
Exactly that is what you need, as it's more practical.
Copy link to clipboard
Copied
do you mean making movie clip instead?
Copy link to clipboard
Copied
For example in the first key frame you've added these two event listeners to the home button
home_btn.addEventListener(MouseEvent.CLICK, intro_ClickToStopAllSounds_1);
home_btn.addEventListener(MouseEvent.CLICK, home_ClickToStopAllSounds_3);
then you moved to another key frame but the home button still listening for that two events, then when you click the home button the functions ClickToStopAllSounds_1 & ClickToStopAllSounds_3 will not be accessible from your current frame, that will cause an error.. so you have to remove the listeners before you go to another key frame.
you have to check all the buttons not only the home button.
Copy link to clipboard
Copied
I think you are right, I will try it again after removing the duplicate listeners
Copy link to clipboard
Copied
بالتوفيق أخي
Copy link to clipboard
Copied
الشكر لك أنت
هل أنت عربي؟
Copy link to clipboard
Copied
نعم أخي أنا من سوريا بس ما حبيت احكي عربي لأنه ما حدا رح يفهم
Copy link to clipboard
Copied
مرحبا بك أخي الفاضل وشكرا على المساعدة
هل من الأفضل عمل موفي كليب بدلا من استيراد ملف سويف؟
Copy link to clipboard
Copied
عفواً أخي وأهلا وسهلا فيك
بخصوص الفريمات لو بتخلي الأزرار العامة متل الهوم والإنفو بطبقة تانية مع الأوامر الخاصة فيهم بحيث تقدر تستخدمهم من أي فريم
أما الأزرار الخاصة بكل صفحة فخليهم على حالهم
المفروض دائماً تستخدم هالاسلوب لأنه عملي أكتر
تحياتي وموفق
Copy link to clipboard
Copied
لا الأفضل الاستيراد عشان حجم التطبيق يكون صغير
Copy link to clipboard
Copied
شكرا مرة أخرى ، سوف أستمع لنصحك
وسوف أحاول ذلك مرة أخرى
هل يمكن أنتسمح لي بالتواصل معك عبر فيسوبوك أو أي وسيلة اتصال؟
Thanks again, I will listen to advice
I will try it again
Copy link to clipboard
Copied
العفو وأهلا بك
Copy link to clipboard
Copied
I've tried everything you advised me to do, but the problem still as it is not resolved.
Can you help me and correct coding in the file and then send it to me?
Copy link to clipboard
Copied
I've been having a problem related to Flash project Android, app, I asked help from Forum members, You helped me to solve it.
Thanks Nezarov
Copy link to clipboard
Copied
You're welcome thank you too.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now