You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The event script below works on 0.6.3, but doesn't on 0.7.3. I'm trying to fix it, but it just keeps showing the 'Tried to access a null variable bitmapData' error. If anyone knows how to resolve the error, lemme know:
-- Function to create the video event
function onEvent(name, value1, value2)
if name == "playVideo" then
local videoName = value1 -- The name of the video file is passed as value1
-- Create a sprite for the video
makeLuaSprite('videoSprite','',0,0)
setObjectCamera('videoSprite', 'hud');
addLuaSprite('videoSprite', false)
-- Add necessary libraries for video handling
addHaxeLibrary('MP4Handler','vlc')
addHaxeLibrary('Event','openfl.events')
-- Run Haxe code to handle video playback
runHaxeCode([[
var filepath = Paths.video(']] .. videoName .. [[');
var video = new MP4Handler();
video.playVideo(filepath);
video.visible = false;
setVar('video',video);
FlxG.stage.removeEventListener('enterFrame', video.update);
]])
end
end
function onUpdatePost()
-- Update video frame and handle volume
runHaxeCode([[
var video = getVar('video');
game.getLuaObject('videoSprite').loadGraphic(video.bitmapData);
video.volume = FlxG.sound.volume + 100;
if(game.paused) video.pause();
]])
end
function onResume()
-- Resume video playback when the game is resumed
runHaxeCode([[
var video = getVar('video');
video.resume();
]])
end
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
Nope, nothing in source code
The text was updated successfully, but these errors were encountered:
Describe your problem here.
The event script below works on 0.6.3, but doesn't on 0.7.3. I'm trying to fix it, but it just keeps showing the 'Tried to access a null variable bitmapData' error. If anyone knows how to resolve the error, lemme know:
-- Function to create the video event
function onEvent(name, value1, value2)
if name == "playVideo" then
local videoName = value1 -- The name of the video file is passed as value1
end
function onUpdatePost()
-- Update video frame and handle volume
runHaxeCode([[
var video = getVar('video');
game.getLuaObject('videoSprite').loadGraphic(video.bitmapData);
video.volume = FlxG.sound.volume + 100;
if(game.paused) video.pause();
]])
end
function onResume()
-- Resume video playback when the game is resumed
runHaxeCode([[
var video = getVar('video');
video.resume();
]])
end
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
Nope, nothing in source code
The text was updated successfully, but these errors were encountered: