Now always using Scratch.createMediaInfo() to create MediaInfo instances.

This commit is contained in:
Shane M. Clements 2014-05-22 13:23:05 -06:00
parent c04d479129
commit 02622918a8
3 changed files with 8 additions and 9 deletions

View file

@ -208,7 +208,7 @@ public class SpriteThumbnail extends Sprite {
public function objToGrab(evt:MouseEvent):MediaInfo {
if (targetObj.isStage) return null;
var result:MediaInfo = new MediaInfo(targetObj);
var result:MediaInfo = app.createMediaInfo(targetObj);
result.removeDeleteButton();
result.computeThumbnail();
result.hideTextFields();

View file

@ -256,19 +256,18 @@ public class MediaInfo extends Sprite {
//------------------------------
public function objToGrab(evt:MouseEvent):* {
var result:MediaInfo = new MediaInfo({
var result:MediaInfo = Scratch.app.createMediaInfo({
type: objType,
name: objName,
md5: md5
});
if (mycostume) result = new MediaInfo(mycostume, owner);
if (mysound) result = new MediaInfo(mysound, owner);
if (mysprite) result = new MediaInfo(mysprite);
if (scripts) result = new MediaInfo(scripts);
if (mycostume) result = Scratch.app.createMediaInfo(mycostume, owner);
if (mysound) result = Scratch.app.createMediaInfo(mysound, owner);
if (mysprite) result = Scratch.app.createMediaInfo(mysprite);
if (scripts) result = Scratch.app.createMediaInfo(scripts);
result.removeDeleteButton();
if (thumbnail.bitmapData) result.thumbnail.bitmapData = thumbnail.bitmapData;
//if (getBackpack()) result.fromBackpack = true;
result.hideTextFields();
return result;
}

View file

@ -78,7 +78,7 @@ public class MediaPane extends ScrollFrameContents {
var result:Array = [];
var viewedObj:ScratchObj = app.viewedObj();
for each (var c:ScratchCostume in viewedObj.costumes) {
result.push(new MediaInfo(c, viewedObj));
result.push(Scratch.app.createMediaInfo(c, viewedObj));
}
return result;
}
@ -87,7 +87,7 @@ public class MediaPane extends ScrollFrameContents {
var result:Array = [];
var viewedObj:ScratchObj = app.viewedObj();
for each (var snd:ScratchSound in viewedObj.sounds) {
result.push(new MediaInfo(snd, viewedObj));
result.push(Scratch.app.createMediaInfo(snd, viewedObj));
}
return result;
}