Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ActionScript 3.0 Coding for loading swf files

New Here ,
Dec 20, 2012 Dec 20, 2012

I'm a first year teacher.  Teaching Adobe Flash CS6 to high school students.  My students were creating a "final" portfolio project where they used ActionScript 3.0 code, code snippets, and buttons to create a home screen that you could interact with and when you click on each button, it would take you to the individual projects the students have completed throughout the semester.  All project .fla and .swf files were saved under the same student folder as their portfolio project.  The following code was used:

mgrb.addEventListener(MouseEvent.CLICK,openSwf);

function openSwf(event:MouseEvent):void

{

var request:URLRequest=new URLRequest("file name.swf")

navigateToURL(request);

}

When the students try to test using Flash Play (ctrl+enter) in their document, the buttons took them nowhere but their code was perfect.  However, if I open their file from my computer, I could see their buttons worked and loaded the swf file they wanted the button to go to.  The only difference I can come up with is that the student's computers are set to auto update and they are now using Flash Player 11.2.  However, my computer is not set to auto update and I am using Flash Play 9.0.  This was very discouraging for my students to think their code didn't work, when if fact, it did.  Any help would be greatly apprecaited.  There should be no reason for us to revert back to 9.0 just so their files will work.  Something either needs to be fixed or my code needs to be updated so that 11.2 can read it?

By the way, to show my students that their files truly worked, I had them open their swf file using internet explorer and they worked just fine.  It's just that they cannot test their file while working int he flash document through flash player.  Not an acceptable solution but at least the students can see the code worked.

TOPICS
ActionScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2012 Dec 20, 2012

that's probably triggering a security sandbox error. 

among the several remedies is to add the flash file folder (or files) to the trusted files:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 20, 2012 Dec 20, 2012

Just tried adding the student files to the trusted files per your suggestion above.  Still no luck.  The error I'm getting is a Windows Internet Explorer "Cannot find path ..............  Make sure the path or internet address is correct."  Again, Works just fine on my computer...but not the student computers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2012 Dec 20, 2012
LATEST

make sure there's no space in filename.swf and make sure you are using the correct case for that file name.  ie, filename.swf is not the same as filename.SWF on some operatiing systems.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines