这学期要学Flash,Wine 了一个flash8

新手涉及到的教学或入门贴,推荐新手必看,版主维护
回复
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

这学期要学Flash,Wine 了一个flash8

#1

帖子 TeliuTe » 2015-03-03 17:42

安装好Wine,点主按钮输入wine,点中间的配置wine,确定
把绿色精简版,解压到主文件夹的 .wine/drive_c/windows/ 里,然后右键,打开方式,选择wine打开即可

存在的问题:怎么给文件夹里的flash.exe创建一个快捷方式放到桌面上,每次找起来太麻烦,直接创建链接,打不开
附件
wineflash.jpg
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 这学期要学Flash,Wine 了一个flash8

#2

帖子 poloshiao » 2015-03-03 18:22

存在的问题:怎么给文件夹里的flash.exe创建一个快捷方式放到桌面上
http://askubuntu.com/questions/137151/h ... alled-apps
How does one create a custom application launcher for Wine installed apps?
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#3

帖子 TeliuTe » 2015-03-03 21:06

多谢,明天去试试。用创建.desktop文件的方法,里面的用户名(USER)是否支持变量做成通用版的,$LOGNAME

foobar.desktop

代码: 全选

[Desktop Entry]
Name=FooBar
Comment=Foo & Bar
Exec=sh -c "cd /home/USER/.wine/drive_c/Program\ Files/FOOBAR_FOLDER; wine foobar.exe"
Icon=wine
Terminal=false
Type=Application
Categories=Wine;
StartupNotify=true
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 这学期要学Flash,Wine 了一个flash8

#4

帖子 poloshiao » 2015-03-03 21:16

Exec=sh -c "cd /home/USER/.wine/drive_c/Program\
試試
Exec=sh -c "cd $HOME/.wine/drive_c/Program\
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#5

帖子 TeliuTe » 2015-03-03 21:41

好的,明天去学校试试看,这样直接打包在程序里,让学生解压完,复制到桌面上去即可
早上试了试,把文件夹创建链接,复制到桌面点击可以打开文件夹
onlylove
论坛版主
帖子: 5213
注册时间: 2007-01-14 16:23

Re: 这学期要学Flash,Wine 了一个flash8

#6

帖子 onlylove » 2015-03-03 23:17

感觉老师好辛苦,本来这事在windows下面就不是事,不过,为啥我上学的时候老师没教flash
#include <stdio.h>
void main()
{
double world;
unsigned letter;
short stay;
long memories;
printf("I miss you.\n");
}
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#7

帖子 TeliuTe » 2015-03-05 12:28

poloshiao 写了:
Exec=sh -c "cd /home/USER/.wine/drive_c/Program\
試試
Exec=sh -c "cd $HOME/.wine/drive_c/Program\
试了一下,程序可以执行,但是图标Icon没法用这个变量,用绝对路径则可以显示,有没有办法让图标也可以用变量的?

代码: 全选

[Desktop Entry]
Name=Flash
Comment=Flash 8
Exec=sh -c "cd $HOME/.wine/drive_c/windows/Flash\ 8; wine Flash.exe"

Icon=/home/teliute/.wine/drive_c/windows/Flash 8/flash.ico

Terminal=false
Type=Application
Categories=Wine;
StartupNotify=true
附件
flash-ico.png
flash-ico.png (10.23 KiB) 查看 62980 次
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 这学期要学Flash,Wine 了一个flash8

#8

帖子 poloshiao » 2015-03-05 13:27

Icon=/home/teliute/.wine/drive_c/windows/Flash 8/flash.ico
图标Icon没法用这个变量,用绝对路径则可以显示,有没有办法让图标也可以用变量的?
讓相對路徑也可以
試試
Exec=bash -c "export PATH=$PATH:`dirname %k`; your_command"
參閱
http://askubuntu.com/a/345123/198920
How can I set the 'Path' variable in a .desktop file to be relative to the location where the desktop file is located?
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#9

帖子 TeliuTe » 2015-03-05 13:31

多谢解答,刚才试着写了一个flash.sh的脚本,把图标和桌面项目文件复制一下,然后替换里面的路径

不知何故,如果先加可执行权限,会提示“cp: 无法获取"./flash.desktop" 的文件状态(stat): 没有那个文件或目录”,自动加了一个Name[CN]的项,文件名也变成flash.desktop.desktop,
替换完再加可执行权限就可以正常完成。

代码: 全选

#!/bin/bash
cp ./flash.ico $HOME/.wine/drive_c/windows/Flash\ 8/
cp ./flash.desktop $HOME/桌面

#加一个自我删除的命令,文件夹留着以后保存flash文档
rm ./flash.ico
rm ./flash.desktop
rm ./flash.sh

cd $HOME/桌面
find -name 'flash.desktop' -exec sed -i 's;@@;'$HOME';' {} \; 
chmod +x flash.desktop
解压到主文件夹,运行flash.sh,火狐下载似乎直接存到“下载”里,让学生打开后拖到主文件夹里,
提前点主按钮,运行wine的配置文件,生成.wine,然后在脚本里加上复制flash 8/到.wine的命令
--
需要先运行注册程序,添加一句 nautilus ~/.wine/drive_c/windows/Flash\ 8/

代码: 全选

#!/bin/bash
#不用复制ico直接打包到压缩包里
#cp ./flash.ico $HOME/.wine/drive_c/windows/Flash\ 8/

cp ./flash.desktop $HOME/桌面

cd $HOME/桌面

find -name 'flash.desktop' -exec sed -i 's;@@;'$HOME';' {} \; 
chmod +x flash.desktop

nautilus ~/.wine/drive_c/windows/Flash\ 8/
附件
flash.7z
(2.75 KiB) 已下载 409 次
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 这学期要学Flash,Wine 了一个flash8

#10

帖子 poloshiao » 2015-03-05 14:05

#!/bin/bash
cp ./flash.ico $HOME/.wine/drive_c/windows/Flash\ 8/
cp ./flash.desktop $HOME/桌面
./flash.ico
./flash.desktop
指當下的目錄尋找 flash.ico 或 flash.desktop
你沒有 cd 切換到 你存放 flash.ico 或 flash.desktop 的目錄

icon 的路徑問題
如果是絕對路徑 就使用絕對路徑
如果是相對路徑 按照這個 Icon Theme Specification 規範
http://freedesktop.org/wiki/Standards/icon-theme-spec

資料來源
http://standards.freedesktop.org/deskto ... atest.html
使用 icon 搜尋

如果 Icon Theme Specification 規範 複雜
可以在你加的 flash.sh 脚本
把 flash.ico 複製到 /home 以外的目錄 例如
/usr/share/icons/hicolor/48x48/apps/
然後 Icon 使用絕對目錄
Icon=/usr/share/icons/hicolor/48x48/apps/flash.ico
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#11

帖子 TeliuTe » 2015-03-17 11:15

使用脚本的时候提示:

代码: 全选

无法找到对动作脚本 2.0 进行类型检查所需的文件“toplevel.as”。
请确保目录“$(LocalData)/Classes”在动作脚本首选参数的全局类路径中列出
网查一下,是缺少toplevel.as,检查有这个文件,到首选项的脚本设置里看一下也没什么,
手动添加路径后正常,
然后删除添加的路径还能找到,不再报错,不懂是什么原因之前报错,后面却又不报错了
附件
fa1.png
fa1.png (7.28 KiB) 查看 62715 次
头像
月下叹逍遥
论坛版主
帖子: 33994
注册时间: 2010-10-07 14:23
系统: Archdows10
来自: 某系某星某洲某国某省某市
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#12

帖子 月下叹逍遥 » 2015-03-17 11:16

flash早晚要挂掉的,毕竟HTML5大趋势啊。。。说的好没底气的说
浮生七十今三十,从此凄惶未可知
头像
nyfair
帖子: 1067
注册时间: 2007-12-07 12:49
系统: winnux10
来自: Tree New Bee

Re: 这学期要学Flash,Wine 了一个flash8

#13

帖子 nyfair » 2015-04-08 11:56

html5大势所趋?去他妈的,adobe air才是王道
cute is magic, niconico poi
本人在此论坛仅负责吐槽,问题急需解决请支付宝转账5毛至{我的id@qq.com},将会竭诚为您服务

linux常见多媒体问题处理指南

1. 视频播放有问题->卸载gstreamer
2. 音频播放有问题->卸载pulseaudio
3. 远程播放有问题->卸载avahi
4. 系统全都有问题->卸载systemd,远离Lennart这傻逼让你从此轻松自在

⇩自由网络⇩
https://github.com/nyfair/freeweb
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 这学期要学Flash,Wine 了一个flash8

#14

帖子 TeliuTe » 2017-05-31 19:30

计划给指法练习里面打字出错加上一个音效
1、导入MP3音乐到库,64KB静态,用audacity导出音频,只能导入标准格式MP3音乐
2、在库面板,右键-链接,勾选第一个复选框,输入第一个文本框的标识符
3、在帧动作里输入代码

代码: 全选

errSound = new Sound(); //定义声音类
errSound.attachSound("err_snd"); //提取库中我们所设定的ID
errSound.start(); //开始播放声音,放在需要的地方

代码: 全选

简单播放音乐 来源:http://www.jb51.net/flash/base/71725.html

1. 首先打开新的Flash文件, 把声音导入库中 (还摸不清介面的朋友就按ctrl+r) 
2. 导入之后到库中定义声音的ID, 如图: 
*** 这里的ID和场景上的实体名是不一样的 *** 
3. 接下来就在第一帧编写代码, 如下 
mySound = new Sound(); //定义声音类 
mySound.attachSound("tomato"); //提取库中我们所设定的ID 
mySound.start(); //开始播放声音 
4. 测试结果.. 

音乐的开始, 停止和循环 
mySound.start([Secondsoffset], loop); 
start当中的两个参数分别为Secondsoffset, Seconds就是秒数而offset就是抵消或取消的意思...所以简单的说就是取消开始播放,以秒数来计算... 没有定义的话就是0, 另外一个loop就是循环了... 
mySound.start(5, 99); 
这个意思就是音乐从第5秒开始播放, 并循环99次, 这里提供了个例子为mySound.start(0,99); 
点击浏览该文件 
mySound.stop(); 
mySound.stop("tomato"); //如果new Sound没有定义的话就这样使用, 不然多个声音会全部停止 
这个很简单不用解释了吧...就是停止音乐 
我们看到某些网站所使用的一个按钮控制播放和停止的效果就是使用这些就可以达成了, 如: 
mySound = new Sound(); 
mySound.attachSound("tomato"); 
mySound.start(0,99); //音乐开始播放并循环99次 
var music = true; //定义一个变量记录目前音乐是否是在播放, 因为音乐已经播放所以设定为true 
btn.onRelease = function() { 
if(music) { //当变量为true时就表示音乐是在播放 
mySound.stop(); //使用stop设定音乐停止 
music = false; //变量记录false为音乐停止 
} else { //以下的和以上相反 
mySound.start(0,99); 
music = play; 
} 
} 

setPan 和 setVolume 
mySound.setPan(pan); 
pan的值是介于 -100 到 100, 用意在于设定喇叭的平衡... -100为只能左边的喇叭听到声音, 100为右边的, 而0就是平衡点, 两个喇叭都能听到声音 
例如: 
mySound = new Sound(); 
mySound.attachSound("tomato"); 
mySound.start(0, 10); 
var speaker = -100; //变量设定为-100, 即是从左边喇叭开始 
mySound.setPan(speaker); //设定喇叭平衡 
function pan() { //设定函数并通过setInterval每秒调整平衡 
speaker += 20; //每秒平衡偏移20 
mySound.setPan(speaker); //设定喇叭的平衡 
if(speaker > 100) { //当音乐完全偏移到右边喇叭播放的时候就停止 
mySound.stop(); 
clearInterval(p); 
} 
} 
var p = setInterval(pan, 1000); //开始每秒执行喇叭平衡 
mySound.setVolume(volume); 
volume为0 - 100, 0为静音, 100为最大 
mySound = new Sound(); 
mySound.attachSound("tomato"); 
mySound.start(0, 99); 
var top = key.vol._y; //定义拖动按钮的最高点 
var left = right = key.vol._x; //定义拖动左右的范围 
var bottom = key.vol._y+100; //定义拖动按钮的最低点 
key.vol.onPress = function() { 
this.startDrag(true,left,top,right,bottom); //按钮按下拖动范围 
} 
onEnterFrame = function() { 
v = int(key.textInput.value.text); //取得输入框内的值 
mySound.setVolume(v); //设定音量 
} 

Position, Duration 和 暂停 
mySound.position(); 
唯读指令, 主要是取得目前播放音乐的毫秒数(1秒 = 1000毫秒), 在音乐播放之后才能够取得, 在一开始start()之后使用是无法取得的 
mySound.duration(); 
唯读指令, 主要是取得音乐的总毫秒数 要使音乐暂停, 播放的时候再继续之前暂停的位置开始播放, 我们可以先取得按钮按下暂停时的position以取得位置, 然后再次按下播放的时候就使用start()当中的SecondsOffset使音乐从暂停的部分开始播放, 如: 
mySound = new Sound(); 
mySound.attachSound("tomato"); 
var SecondsOffset = 0; //设定SecondsOffset为0 
p1.onRelease = function() { 
mySound.start(SecondsOffset, 0); //播放按钮按下开始从0offset播放 
} 
p2.onRelease = function() { 
SecondsOffset = mySound.position/1000; //暂停按钮按下时记录目前位置并换成秒数 
mySound.stop(); //音乐暂停 
} 
onEnterFrame = function() { //这里是循环部分 
if(mySound.position == mySound.duration) { //如果播放的毫秒数等于音乐总毫秒数 
mySound.start(0, 99); //开始循环播放99次 
} 
} 

只要会了以上的方法, 倒退播放和快速播放就非常简单了, 如下: 
1. 场景上建立两个按钮, 分别为(倒退 rev 和 快速播放 ff) 
2. 在第一帧使用以下代码 : 

mySound = new Sound(); 
mySound.attachSound("tomato"); 
mySound.start(); 
var SecondsOffset = 0; 
var reverse = foward = false; //设定倒退和前进变量为false 
onEnterFrame = function () { 
if (reverse && mySound.position > 0) { //当倒退按下且音乐秒数大于0 
mySound.stop(); //音乐停止 
SecondsOffset -= .5; //offset倒退0.5秒 
mySound.start(SecondsOffset, 0); //音乐从倒退的0.5秒开始播放 
} 
if (foward && mySound.position <= mySound.duration) { //当快速播放按下且音乐不为结束 
mySound.stop(); 
SecondsOffset += .5; //offset前进0.5秒 
mySound.start(SecondsOffset, 0); 
} 
rev.onPress = function() { //当倒退按下并取得position 
SecondsOffset = mySound.position/1000; 
reverse = true; //reverse变量为true 
}; 
rev.onRelease = function() { //当倒退放开就设定reverse变量为false 
reverse = false; 
} 
ff.onPress = function() { //同上 
SecondsOffset = mySound.position/1000; 
foward = true; 
}; 
ff.onRelease = function() { 
foward = false; 
} 
}; 

至于loadSound部分就写一下进度条的写法 
1. 在场景上建立一个为100%长度的MC(loadBar) 
2. 在第一帧使用以下代码 : 
onLoad = function () { 
mySound = new Sound(); 
mySound.loadSound("tomato.mp3"); //载入同一目录中的MP3 
var percent = 0; //%一开始为0 
loadBar._xscale = percent; //进度条的宽度比例为percent 
}; 
onEnterFrame = function () { 
mySoundBytesTotal = mySound.getBytesTotal(); //取得文件的size 
mySoundBytesLoaded = mySound.getBytesLoaded(); //取得目前文件所载入的size 
percent = int(mySoundBytesLoaded/mySoundBytesTotal*100); //计算出文件所载入的比例 
loadBar._xscale = percent; //设定进度条宽度比例 
if (percent>=100) { //当完全载入之后 
delete onEnterFrame; //删除循环 
mySound.start(); //音乐开始播放 
} 
}; 

Q1. 为何loadMovie当中的swf音乐无法播放? 
ans: 只要在swf当中把 mySound = new Sound() 换成 mySound = new Sound(this) 就可以了 
Q2. 为何不能同时设定两首音乐不同的音量? ans: 一般你们会这样使用AS 
mySound1 = new Sound(); 
mySound1.attachSound("tomato1"); 
mySound1.start(); 
mySound2 = new Sound(); 
mySound2.attachSound("tomato2"); 
mySound2.setVolume(50); //另外一首音量为50 
mySound2.start(); 
但这样是错误的, 正确方法是分别把音乐分开在不同的层当中 : 
mySound1 = new Sound(this); 
mySound1.attachSound("tomato1"); 
mySound1.start(); 
createEmptyMovieClip("mc", 0); 
mySound2 = new Sound(mc); 
mySound2.attachSound("tomato2"); 
mySound2.setVolume(50); 
mySound2.start(); 
回复