资源简介 FileIO Xtra for Macromedia Authorware 6.0Copyright 2001 Macromedia, Inc.FileIO provides a set of functions allowing users of Macromedia Authorware 6.0 to programmatically access files using scripting.Using FileIO============As an Xtra the FileIO Xtra must be in your application's Xtras folder.Each instance of FileIO can reference a single open file. If multiple files are to be opened simultaneously, a new instance of FileIO is required for each opened file. A single instance can be used to open multiple files, as long as the file is closed before a new file is opened. To create a new instance use NewObject, defined below. To dispose of an instance, set the instance variable to 0. All functions that read from or write to the file must be called after the file has been opened using openFile. If a new file is to be opened using the same instance, the old file must first be closed using closeFile. Files can be opened in three different modes: Read, Write and Read/Write. When writing to a file, the contents of the file after the current position are overwritten.Example Script:-- Create an instance of FileIOmyFile := NewObject("fileio")-- Display an "open" dialog and return the file name to AuthorwaremyFileName := CallObject(myFile, "displayOpen")-- Open the fileCallObject(myFile, "openFile", myFileName, 1)-- Read the file and return a string to AuthorwaretheFile := CallObject(myFile, "readFile")-- Close the fileCallObject(myFile, "closeFile")-- Dispose of the instancemyFile := 0In this example, a new instance was created and stored in the variable myFile. Next, a call to displayOpen is used to display an open dialog to allow a file to be selected. The file name is returned as a fully qualified path string to Authorware. The file is then opened in read-only mode, the contents of the file are read, and the file is closed. Lastly, the instance is disposed.There is also an Authorware Show Me (xtraio.a6p) which demonstrates how to use the Xtra. It can be found in the Show Mes installed with Authorware 6.Known Problems==============The FileIO Xtra cannot use a net-based file when supplied with a URL for the file name. It is limited to accessing files available via file systems mounted on the local system.The displaySave function does not directly inform Authorware whether a user is replacing an existing file. A workaround is to attempt to create the file using createFile and check the error code for a "File Already Exists" error.Function Reference==================closeFileCallObject(object, "closeFile")Closes a file that has been previously opened using openFile.createFileCallObject(object, "createFile", "fileName")Creates a file. The fileName must be either a fileName to be created in the current directory, or a fully qualified path and fileName. Relative paths are not supported. After creating the new file, the file must be opened before it can be written to.deleteCallObject(object, "delete")Deletes the currently opened file. The file must be open to use this function.displayOpenCallObject(object, "displayOpen")Displays a platform specific "open" dialog allowing a user to select a file. Returns a fully qualified path and fileName to Authorware. The setFilterMask function can be used to control what file types are displayed in the dialog.displaySaveCallObject(object, "displaySave", "title", "defaultFileName")Displays a platform specific "save" dialog allowing a user to specify a file. Returns a fully qualified path and fileName to Authorware. The setFilterMask function can be used to control what file types are displayed in the dialog. The title and defaultFileName parameters allow you to specify a default filename to be displayed, as well as title text for the save dialog.errorCallObject(object, "error", status)Returns a readable error string. A numeric error code is passed in as the third argument. (Also refer to the 'status' function.) The errors returned can be any of the following:"OK""Memory allocation failure""File directory full""Volume full""Volume not found""I/O Error""Bad file name""File not open""Too many files open""File not found""No such drive""No disk in drive""Directory not found""Instance has an open file""File already exists""File is opened read-only""File is opened write-only""Unknown error"fileNameCallObject(object, "fileName")Returns the file name string of the current open file. The file must be open use this function.getFinderInfoCallObject(object, "getFinderInfo")Returns the Type and Creator of the current file as a string. This function does nothing when used under Windows. The file must be open to use this function.getLengthCallObject(object, "getLength")Gets the length of the currently opened file. Returned as an integer. The file must be open to use this function. The value returned is the length of the file in bytes.getOSDirectorygetOSDirectory()A function that returns the full path to either the Windows directory, or the System Folder depending on which OS is currently being used. Does not require a child instance to call.getPositionCallObject(object, "getPosition")Gets the file position of the current open file. Returned as an integer. The file must be open to use this function.NewObjectNewObject("fileio")This is called to create a new instance of FileIO. It returns an instance variable used to reference the instance.openFileCallObject(object, "openFile", "fileName", mode)Opens the named file. This call must be used before any read/write operations can take place. The filename can be either a fully qualified path and filename, or a relative filename. The openMode parameter specifies whether to open the file in Read, Write or Read Write mode. Valid Flags are: 0 Read/Write, 1 Read, 2 Write.readCharCallObject(object, "readChar")Reads the character (either single or double-byte) at the current position and then increments the position. The character is returned to Authorware as a string. The file must be open in read or read/write mode to use this function.readFileCallObject(object, "readFile")Reads from the current position to the end of the file and returns the file to Authorware as a string. The file must be open in read or read/write mode to use this function.readLineCallObject(object, "readLine")Reads from the current position up to and including the next Return, increments the position, and returns the string to Authorware. The file must be open in read or read/write mode to use this function.readTokenCallObject(object, "readToken", "skip", "break")Reads the next 'token' starting at the current position. Characters matching the 'skip' parameter are "skipped" and the file is read until 'break' is encountered. The file must be open in read or read/write mode to use this function. This function will read double-byte tokens as long as the skip and break are single-byte characters. It will not detect double-byte skip or break characters.readWordCallObject(object, "readWord")Reads the next word starting at the current position. The file must be open in read or read/write mode to use this function.setFilterMaskCallObject(object, "setFilterMask", "mask")Sets the filter mask used by calls to displayOpen and displaySave. The filter mask determines what files to show when displaying an "open" or "save" dialog. The third parameter is a string representing the filter mask to set.On Windows, this is a comma-separated string of file types and associated extensions (e.g. "All Files,*.*,Text Files,*.TXT"), and a string of types on the Macintosh (e.g. "TEXTPICT"). On Windows, the filter mask string is limited to 256 characters.On the Macintosh, you are limited to four four-character types. When a new instance of FileIO is created, the filter masks defaults to all files. To reset the filter mask to display all files after it has been set, just pass in an empty string, e.g. CallObject(object, "setFilterMask", "").setFinderInfoCallObject(object, "setFinderInfo", "attributes")Sets the Type and Creator of the current file. The string takes the form of a space-separated set of TYPE and CREATOR codes (e.g. "TEXT TTXT"). This function does nothing when used under Windows. The file must be open to use this function.setPositionCallObject(object, "setPosition", position)Sets the file position of the current open file. The file must be open to use this function.statusCallObject(object, "status")Returns the error code returned by the last function called. The value is returned as an integer. (Also refer to the 'error' function.)versionCallParentObject("fileio", "version")Returns FileIO version and build information. Useful when filing bug reports, or determining installed version while authoring. No practical use beyond this.writeCharCallObject(object, "writeChar", "theChar")Writes a single character to the file at the current position. The file must be open in write or read/write mode to use this function.writeStringCallObject(object, "writeString", "theString")Writes a string to the file at the current position. The file must be open in write or read/write mode to use this function.===(共40张PPT)(一)教材分析1 、主要内容:张骞通西域和丝绸之路2 、本课重点:张骞通西域、丝绸之路3 、本课难点:如何正确认识丝绸之路的文化内涵及其在中西文化交流中的重要地位.(二)教学目标1、情感、态度与价值观: 通过对张骞克服困难,不辱使命的史实的学习,培养不畏艰难险阻、勇于开拓、献身祖国的崇高精神和坚强意志; 通过对西汉时期中西方经济文化交流的学习,认识东西方文明交融的重要性和对我国社会发展的作用。 通过丝路访古、丝路畅想来培养青年人应有的历史情怀和历史责任感,热爱西部热土,关注西部开发,献身西部建设。2、能力目标:·能够正确识读“张骞通西域路线图”和“丝绸之路示意图” ,初步掌握识别和使用历史地图的基本技能;·能够正确认识张骞在西汉民族交往中的作用和丝绸之路在中西文化交流中的地位,初步培养正确认识、评价历史人物和历史事件的能力。·通过合作查阅资料、尝试自主设计丝路访古导游图,培养学生自主学习、合作探究的能力。3、知识目标:西域;张骞;张骞通西域的原因、 时间和作用;丝绸之路的路线、作用等基本史实;(三)课前导学1、布置预习,收集学生提出的在新课学习中想要了解的问题有哪些,并做好相应的备课准备。2、让学生搜集有关“阳关”、“玉门关”的诗词片段、张骞的资料和与丝绸之路有关的物品。3、指导学生从网上搜集有关丝绸之路的图片,并以小组为单位,尝试设计丝路访古导游图。(四)教学过程和教学方法1、张骞通西域:合作探究式学习2、丝绸之路:体验式、探究式学习3、丝路畅想:探究式学习,总结提升本课内容西部歌王—王洛宾的这首脍炙人口的民歌叫什么名字?它反映的是我国什么地方?新疆原来叫什么名字?它何时并入中国版图的?在这期间,曾经有过多少风风雨 雨、曲曲折折?有过多少动人而悲壮的故事?第15课 张骞通西域和丝绸之路导学目标 1、西域在今天的什么地方? 2、张骞为什么要出使西域?他身上有什么优秀品质值得我们学习? 3、什么是丝绸之路?它有什么历史作用?对我们有什么影响? 4、丝绸之路沿线有什么名胜古迹、迷人风光? 5、我们为什么要关注西部这片热土?请你找出西域的大致位置?西汉疆域图汉武帝为何派张骞出使西域?(1)联络大月氏夹击匈奴,巩固西北边防。(2)开拓疆土。张骞第一次出使西域表示张骞第二次出使西域路线张骞出使西域有何历史意义?1 、打通了西汉和西域的通道,西域于公元前60年正式归西汉中央政权管辖。2 、开辟了中国和欧洲、非洲大陆的通道┄丝绸之路。张骞出使西域遇到了什么困难?他出使西域的成功给了我们什么启示?(1)立志高远,报效祖国.(2)有胆、有识、有行、有恒.他是一位冒险家,又是一个天才的外交家,同时又是一员战将,真可谓中国历史上出类拔萃之人物也----(史学家)翦伯赞西汉武帝时张骞两次出使西域,开通了一条自首都长安出发,经河西走廊和天山南路,直达中亚、西亚,进而连接欧洲和非洲大陆的陆路通道。精美的中国丝绸输往西方国家,西方国家的物产也传入中国。这条东西方交流的通道被称作“丝绸之路”。1.名称由来丝绸之路东起中国古都长安,西至地中海东岸。2.丝路驿站3.丝路意义丝绸之路是一条具有历史意义的国际通道,正是这条古道把古老的中国文化、印度文化、波斯文化、阿拉伯文化和古希腊、古罗马文化连接起来,促进了东西方文明的交流。试从政治、经济、宗教、文化等方面概括丝绸之路的历史意义。(1)加强了中外友好往来(2)密切了中外经济联系(3)促进了中外文化交流(4)世界宗教在中国传播古代东西方经济文化交流代名词4.历史沉寂斗转星移、岁月变化,举世闻名的丝绸之路没有了往日的喧嚣繁华而尽现孤寂苍凉?(1)环境变迁 路途险恶(2)关卡重重 交通阻断(3)远洋探险 海运发展5.丝路访古那一条丝路 在河西流淌从苍凉的甘肃大漠 到火热的新疆……我从兰州走到 乌鲁木齐却看不清丝路的 千年风霜……知识要点一、张骞通西域1、西域位置和范围2、张骞两次通西域时间 目的 经过 意义3、丝绸之路主要路线 历史作用5.丝路畅想 西域各族人民曾经为中华文明及世界文明作出了重大贡献。而今,西部正在崛起,沉寂了千年的丝绸之路正在重振昔日的辉煌.那建设好西部对我国社会发展有何重大意义呢 (1)战略安全 祖国主权( 2 )西部开发 能源基地第二亚欧大陆桥丝绸之路(3)对外交往 重要通途永逝的风景:楼兰古国古胡杨(4)环境保护 持续发展(五)推荐书目《张骞通西域和丝绸之路》教学设计稿一、教材内容分析本课主要内容有二部分:张骞通西域和丝绸之路的开辟,前后因果,但独自成目。关注的是西汉时期我国的民族关系和中西经济文化交往的情况。但教材突出的是西汉对外友好交往的盛况和中西方文明的交融。张骞通西域是汉朝对外交往当中最为重要的事件之一,它为丝绸之路的开辟和西域正式归属西汉中央政权管辖奠定了基础。自然,这是本课学习的一个重点。但限于课时限制,本课主要学习张骞通西域的历史意义和张骞的优秀品质。丝绸之路是本课的主线。丝绸之路的开辟打通了中西陆路交通,从而极大的便利和促进了中西经济文化交流,丝绸之路也就成了中西经济文化交流的代名词和中外友好交往的历史见证,影响重大,地位突出。自然,丝绸之路就成了本课学习过程中师生共同关注的重中之重。如何让初中学生穿越历史的时空,以今天的眼光去探寻历史,以历史的眼光看待今天,去理解丝绸之路丰富的文化内涵和在中西经济文化交往中的重要地位,这是本课学习中的一大难点。二、教学目标设定基于上述教材内容的分析,我对本课确定了如下教学目标:1、情感、态度与价值观目标:通过对张骞克服困难,不辱使命的史实的学习,培养学生不畏艰难险阻、勇于开拓、献身祖国的崇高精神和坚强意志;通过对西汉时期中西方经济文化交流的学习,认识东西方文明交融的重要性和对我国社会发展的巨大作用。通过丝路访古、丝路畅想来培养青年人应有的历史情怀和历史责任感,热爱西部热土,关注西部开发,献身西部建设。2、能力目标:能够正确识读“张骞通西域路线图”和“丝绸之路示意图” ,初步掌握识别和使用历史地图的基本技能;能够正确认识张骞在西汉民族交往中的作用和丝绸之路在中西文化交流中的地位,初步培养正确认识、评价历史人物和历史事件的能力。通过合作查阅资料、尝试自主设计丝路访古导游图,培养学生自主学习、合作探究的能力。3、知识目标:西域;张骞;张骞通西域的原因、时间和作用;丝绸之路的路线、作用等基本史实;三、课前导学1、布置预习,收集学生提出的在新课学习中想要了解的问题有哪些,并做好相应的备课准备。2、让学生搜集有关“阳关”、“玉门关”的诗词片段和张骞的资料。3、指导学生从网上搜集有关丝绸之路的图片,并以小组为单位,尝试设计丝路访古导游图。四、教学过程和教学方法本课的学习分三部分。第一部分张骞通西域:合作、探究式学习;第二部分,丝绸之路:体验式、探究式学习;第三部分,总结提升本课内容:探究式学习。五、目标达成下面我就结合课件展示,来说明一下我是如何运用恰当的教与学的方法,来突出学习的重点,突破学习中的难点,顺利达成上述教学目标的。我的这个小课件是用Powerpoint制作的,丝路访古一段是用Authorware制作的,我的想法是,课件一要简单实用,便于操作,二要符合新的课程理念,在对教材进行充分研究的基础上,实现教学内容的心理化、问题化、结构化和可操作化,从而实现教学过程和教学效果的最优化。(边展示课件,边作说明)导入。选择《在那遥远的地方》来导入,原因有二,一是这首西部民歌脍炙人口、广为流传,学生感觉熟悉、亲切,二是让学生在歌声中去感受那遥远的地方、美丽的姑娘和西部浓郁的民族风情,去探寻那遥远地方的那段令人难于忘怀的遥远历史。第一部分:张骞通西域。从西域的位置和大致范围、通西域的目的、简要经过和历史作用来展开。教师通过组织讨论、指导学生读图、识图、让学生自讲故事等形式进行探究性学习。此目内容比较简单,学生课前的预习已基本可以解决。所以出使过程简化,重点放在张骞出使西域的目的、结果,和他的精神对我们的启示上。通过对第三个问题的讨论,使学生从张骞身上受到自我教育:立志高远、报效祖国和成功者应具备的基本素质:有胆、有识、有行、有恒。在第一和第二部分之间,用一段flash作为过渡第二部分:丝绸之路。这是本课学习的重点,同时也是学习的难点,所以应当花较多时间来探讨。为了突出这一重点,这里主要从丝绸之路的名称由来、丝路驿站、历史意义、历史变迁、丝路访古五个方面,层层展开、层层深入,力图让学生对丝绸之路的古今变迁、历史地位、丰富内涵有一个比较全面的了解。为了突破理解丝绸之路丰富的文化内涵和在中西经济文化交往中的重要地位这一教学难点,我从以下几个方面入手:1、指导学生从经济、政治、宗教、文化4个方面归纳总结丝绸之路的历史作用,理解丝绸之路的历史地位。2、通过师生共同讨论丝绸之路的历史变迁及原因,来感受丝绸之路的历史厚重。3、师生一同进行丝路访古,我把它叫做“体验式学习”。这是本课的一个高潮。先用投影仪展示1—2份学生课前准备好的丝路访古导游图,后播放教师制作的作品,并作富有感彩的导游解说,每一景点都用一首打油诗来总结,让学生充分领略丝绸之路的无穷魅力,并展示执教者应有的文学素养和历史情怀。比如,结束西安旅游后得诗一首:咸阳古道足下行,华清池畔论古今。六朝古都兴衰事,几曾风雨几曾晴。通过以上的学习,帮助学生初步地理解丝绸之路丰富的文化内涵和在中西经济文化交往中的重要作用。第三部分:丝路畅想。这是对本课教学内容的总结提升,使学生从国家安全、经济发展、对外交往、环境保护等几个方面来关注西部。目的有两点,一是培养学生热爱西部、热爱祖国的思想情感,二是让学生认识到昔日辉煌的丝绸之路,对于今天来讲,是东西方的“对话之路”,是一条通向未来的开放之路、奋进之路、光明之路,从而促使学生更好地理解丝绸之路丰富的文化内涵和在中西经济文化交往中的重要地位。结尾。向学生提供课外学习的资料信息,作为课堂学习的延伸。最后,在《在那遥远的地方》歌声中结束,首尾呼应,加深学生的情感体验。谢谢各位专家评委的指导。- 1 - 展开更多...... 收起↑ 资源列表 1.swf sczl.swf sichou.swf SR.mp3 zqtxy.ppt 在那遥远的地方.mp3 张骞通西域和丝绸之路.doc